home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18167 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.7 KB

  1. Path: sparky!uunet!caen!mtu.edu!abcd.Houghton.MI.US!Leon
  2. From: Leon@abcd.Houghton.MI.US (Leon)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Busy file?  How do I wait?
  5. Distribution: world
  6. Message-ID: <Leon.0bxy@abcd.Houghton.MI.US>
  7. Date: 5 Jan 93 12:27:06 EST
  8. Organization: Amiga BitSwap Central Dispatch
  9. Lines: 37
  10.  
  11. I've just written a program in a BBS environment.
  12.  
  13. Since I have three lines, it is inevitable that at SOME time, more than one
  14. person will be using the program at the same time...  It reads from two
  15. files and rewrites both of them...  Even though the run time is EXTREMELY
  16. short, I know there are potential problems...
  17.  
  18. Right now, I'm just checking to see if the file opened successfully and if
  19. not, I exit...  But that's not acceptable for the particular application--I
  20. *NEED* to access the files...
  21.  
  22. Is there a CLEAN way to wait for the files to be closed before I try to
  23. access them???  Is this was a file "lock" is all about???
  24.  
  25. I'm hoping there's an OS-level function I can call that will try to fopen()
  26. and wait for success, assuming that the file was just 'busy' and there
  27. weren't any other problems...
  28.  
  29. As I've said, the run-time is VERY short, so it won't hurt if subsequent
  30. calls to the program must wait for previous calls to complete...  I just
  31. don't want any conflicts...
  32.  
  33. Any help is GREATLY appreciated...
  34.  
  35. Thanks in advance...
  36.  
  37. Bi Bi...
  38.  
  39. \Leon
  40.  
  41. -- Via DLG Pro v0.995
  42.  
  43. ______________________________________________________________________
  44. |  o__ ----       \\ABCD///Amiga BitSwap Central Dispatch - DLG BB/OS!
  45. | _.>/ _-------    \\BBS// 16K8bps - 3 Lines! - Fido/UUCP(906)482-8248
  46. |(_) \(_)Leon Shaner\\\// <leon@abcd.houghton.mi.us> or <leon@mtu.edu>
  47. |________[MTU - CTS] \\/  ...Non-Conformity is a virtue I hold dear...
  48.