home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!mcsun!sun4nl!sun2.iend.wau.nl!HKlompmaker.ZOD.WAU.NL!Hendrik.Klompmaker
- From: Hendrik.Klompmaker@beheer.zod.wau.nl (Hendrik Klompmaker)
- Subject: Re: File locking question
- Message-ID: <Hendrik.Klompmaker.34.726306175@beheer.zod.wau.nl>
- Lines: 46
- Sender: news@sun2.iend.wau.nl (Newsmanager WAU)
- Organization: Wageningen Agricultural University
- References: <Hendrik.Klompmaker.31.726184187@beheer.zod.wau.nl> <ppollet.118.726255594@cismibm.univ-lyon1.fr> <1993Jan5.220346.24647@csx.cciw.ca>
- Date: Wed, 6 Jan 1993 07:42:55 GMT
-
- In article <1993Jan5.220346.24647@csx.cciw.ca> u055@csx.cciw.ca (James Sprenger) writes:
-
- >I don't think this will work 'cause the file that is accessed is
- >redirected from the command line, and not initialized from the TP prog.
- >Even if you did open the file from the TP program, I think you'll run into
- >problems when two people try to write to the file simultaneously (spelling?)
- >Any how, if you are using a Novell NetWare network, its probably best to
- >use semaphores...these netware function are faaaast and you don't have to
- >write your own lowlevel IO routines.
- >
- >>
- >> So my guess is that your program username should:
- >>
- >> -be compiled with $I- (no stop on runtime error)
- >>
- >> -Repeat
- >> -try to open the file in mode $11 (Write and deny ALL)
- >> -Until (IoResult=0) (* nobody else has locked it *)
- >>
- >
- >
- Indeed it does not work. I came up with the following working solution. I
- did not find a way to chech if a file was locked useing ioresult or doserror
- while reset(ing) or append(ing) a file. It does however get set if do the
- following
- {$i-}
- repeat
- setattr(logf,$20); {Archive bit set}
- until doserror = 0;
-
- Indeed you have to write from the TP program directly to avoid share
- conficts in this manner.
-
- Bye
-
- Hendrik
-
- ===============================================================================
- |******** Wageningen Agricultural University. Animal Production Group ********|
- -------------------------------------------------------------------------------
- Hendrik Klompmaker Internet : Hendrik.Klompmaker@Beheer.Zod.Wau.Nl
- System Manager Bitnet : KLOMPMAKER@HWALHW50.BITNET
- Phone : +31 (0)8370-83934 Fax : +31 (0)8370-83962
- Snail : Marijkeweg 40, 6709 PG WAGENINGEN, The Netherlands
- ===============================================================================
-
-