home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / vms / 13608 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  2.2 KB

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