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