home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!mips!swrinde!cs.utexas.edu!convex!constellation!barrister!ted
- From: ted@barrister (Ted Garvin @ UCS/OU)
- Newsgroups: comp.os.vms
- Subject: VAX C File exclusivity problem, HELP!
- Message-ID: <13AUG199210302919@barrister>
- Date: 13 Aug 92 15:30:00 GMT
- References: <01GNG6OC1JD88WW6OR@ccmail.sunysb.edu> <12AUG199213120945@reg.triumf.ca>
- Sender: ted@barrister (Standing on the brink, I pause for reflection.)
- Organization: University of Oklahoma - University Computing Services
- Lines: 32
- News-Software: VAX/VMS VNEWS 1.41
-
- I've perused the VAX C manual, and peered into the RMS manuals (I admit that I
- have no clue as to how to clear RMS buffers in VAX C) and both I and my local
- VAX C guru are stumped, so I'm posing this problem to the readers of this
- group. I'd appreciate E-Mail replies, and will summarize to the net, if
- appropriate.
-
- The proBackgrfo: The same program, run by different users, attempts to
- fopen(filename, "r+") so as to have exclusive use of a file. The routine
- reads from the file, makes a change, rewinds the file, nulls it, rewinds and
- then writes the data back out and then closes it.
-
- The problem: User 1 gets the file and user 2 gets a message that the file is
- in use. User 2's program then cycles through a sleep(1), fopen(filename,"r+")
- loop. If fopen returns a null, it continues to cycle until some arbitrary
- number of iterations has been reached. Then it informs the user of failure and
- offers the chance to repeat the attempt for another round of fopens.
-
- What actually happens is that user 2 waits forever, even after user 1 closed
- the file and exited the program. User 2's program apparently never actually
- checks the file status after receiving one failure.
-
- We're running a Vax with VMS version 5.5, if that info is helpful. Vax C
- version 3.0.
-
- - Ted
- --
- "He is strongly identified with rebels you see, and very popular with rabbles.
- They will follow him and he will fight until the last drop of their blood."
- -- Avon (on Blake) [Blake] _________
- ptgarvin@aardvark.ucs.uoknor.edu | Driver high on stress; do not pass.|In this|
- in the Society: Padraig Cosfhota o hUlad|Barony of Namron,Ansteorra | style |
- Disclaimer: Contents under pressure. Do not puncture or incinerate. |__10/6_|
-