[comp.lang.pascal] Turbo 5.0 and Filemode... Info?

SJS132@psuvm.psu.edu (Steve) (02/22/91)

Hi, I'm using turbo 5.0, and I wanted to use the Filemode
in a program that is used on a network... so that if one
of the copies tries to update the data file while another
is using it, it will stop and wait... I've figured out
some scenerios and ways to work it, but I still come
up with one problem/ answer (DEPENDS on how you look at it)
for all of this...

I set the filemode to ReadAll/WriteONE (the one with it open)
and then when the others get to it, it gives an error.  I just
trap for the error (with {$i-} and then {$i+} and then get the
IOResults)  But I was wondering if I can get the mode that a file
is in, someother way... I cant look for READonly files, because
in effect, it doesnt give it an attribute of readonly, it just
locks it out. Right?

Any ideals or comments?

Oh, By the way, I got the info for Filemode off a BBS from
a friend of mine someplace... I got it typed up, anyone need
a copy?  I guess this only works under turbo pascal... because
its an internal system function... so I cant help those that
are using other varients of pascal...

-Steve