home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!caen!mtu.edu!abcd.Houghton.MI.US!Leon
- From: Leon@abcd.Houghton.MI.US (Leon)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Busy file? How do I wait?
- Distribution: world
- Message-ID: <Leon.0bxy@abcd.Houghton.MI.US>
- Date: 5 Jan 93 12:27:06 EST
- Organization: Amiga BitSwap Central Dispatch
- Lines: 37
-
- 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...
-
- Right now, I'm just checking to see if the file opened successfully and if
- not, I exit... But that's not acceptable for the particular application--I
- *NEED* to access the files...
-
- 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'm hoping there's an OS-level function I can call that will try to fopen()
- and wait for success, assuming that the file was just 'busy' and there
- weren't any other problems...
-
- As I've said, the run-time is VERY short, so it won't hurt if subsequent
- calls to the program must wait for previous calls to complete... I just
- don't want any conflicts...
-
- Any help is GREATLY appreciated...
-
- Thanks in advance...
-
- Bi Bi...
-
- \Leon
-
- -- Via DLG Pro v0.995
-
- ______________________________________________________________________
- | o__ ---- \\ABCD///Amiga BitSwap Central Dispatch - DLG BB/OS!
- | _.>/ _------- \\BBS// 16K8bps - 3 Lines! - Fido/UUCP(906)482-8248
- |(_) \(_)Leon Shaner\\\// <leon@abcd.houghton.mi.us> or <leon@mtu.edu>
- |________[MTU - CTS] \\/ ...Non-Conformity is a virtue I hold dear...
-