TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: HERBERT BUSHONG
from: JERRY COFFIN
date: 1997-08-22 19:09:00
subject: files

On (20 Aug 97) Herbert Bushong wrote to Jerry Coffin...
 HB>     but *I've* never been able to make heads or tails of the allowed
 HB> values for the protmode parameter  (I was going to ask that same
 HB> question, except I was going to ask the values).
Okay, lets take a look at the values:
filebuf::sh_compat  This is the default, left over from before DOS
                    supported networks or sharing.  Nothing else can
                    open the file at the same time at all.
filebuf::sh_none    This is basically the same as sh_compat except that
                    you're being explicit that nobody else can share the
                	file.
filebuf::sh_read    This means others can read, but not write the file.
filebuf::sh_write   This means others can write the file.
You can use a bitwise or on sh_read and sh_write to allow others to
either read or write the file.
Actually making file sharing work is something else again: that's enough
to fill many large volumes (in fact, quite a few large volumes HAVE been
written about it.)
At the risk of oversimplifying things too much to be useful, I'll
summarize file sharing very succintly: While you're modifying something
in a shared file, you generally have to ensure against anybody else
seeing some data between starting and finishing the modification.
You typically use exclusive access for things like sorting a file, where
you're going to rearrange everything.  You typically use read sharing
for a file that's basically static, and everybody just looks at it, but
nobody normally changes it at all.  You typically allow others to read
and write when you have something like a shared database.
When you allow others to read and write a file, you normally have to use
record level locking instead of file locking.  This allows you to ensure
that nobody else is looking at a section of a file while its being
modified.
That's more or less the nutshell version of file and record locking.
It's basically a gross oversimplification of what's really necessary,
and ignores LOTS of important points, but at least might be enough to
give an idea of where to start looking if you need to work with shared
files.  (I.e. it's certainly not enough to do the job, but it might be
enough to give an idea of the direction to look for the data you will
need to do the job...)
    Later,
    Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.