home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 7895 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.3 KB  |  58 lines

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