home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18215 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.0 KB  |  42 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!cunews!freenet.carleton.ca!Freenet.carleton.ca!aa302
  3. From: aa302@Freenet.carleton.ca (Russell McOrmond)
  4. Subject: Re: Busy file?  How do I wait?
  5. Message-ID: <1993Jan6.164219.9798@freenet.carleton.ca>
  6. Sender: news@freenet.carleton.ca (News Administrator)
  7. Reply-To: aa302@Freenet.carleton.ca (Russell McOrmond)
  8. Organization: The National Capital Freenet
  9. References: <Leon.0bxy@abcd.Houghton.MI.US>  
  10. Date: Wed, 6 Jan 1993 16:42:19 GMT
  11. Lines: 34
  12.  
  13.  
  14. In a previous article, Leon@abcd.Houghton.MI.US (Leon) says:
  15.  
  16. >I've just written a program in a BBS environment.
  17. >
  18. >Since I have three lines, it is inevitable that at SOME time, more than one
  19. >person will be using the program at the same time...  It reads from two
  20. >files and rewrites both of them...  Even though the run time is EXTREMELY
  21. >short, I know there are potential problems...
  22.  
  23.   The easiest way is to somehow get an agreement with all the authors of the
  24. utilities that manipulate the files to use a shared semaphore, or some other
  25. way to share the access.  A few examples of this already exist in the Amiga
  26. environment with dlg.library which gives you arbitration for the .MSG
  27. message base, and xferq.library which (as well as many other functions)
  28. gives you shared access to an outbound list of files (For use with network
  29. session handlers, tosser/scanner/packers, GUI outbound managers, file
  30. request handlers, etc).
  31.  
  32. >Is there a CLEAN way to wait for the files to be closed before I try to
  33. >access them???  Is this was a file "lock" is all about???
  34.  
  35.   I don't know of any way other than to 'poll' the file to actually check
  36. for things.  You might want to look into AmigaDos 2.0 file notification to
  37. find out if it will notify you once a file is closed.
  38. -- 
  39.  Russell McOrmond, Ottawa Ontario, Canada    | Standard Disclaimer applies.
  40.  Freenet: aa302@freenet.carleton.ca (Faster) | WPL 'keeper of sources'.
  41.  Home: rwm@Atronx.OCUnix.On.Ca,  1:163/109   | Libertyware Telecomunications.
  42.