home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10192 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.3 KB  |  34 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!benjy
  3. From: benjy@athena.mit.edu (Benjamin B Thomas)
  4. Subject: How do I tell if a file is open for writing?
  5. Message-ID: <1992Aug20.031946.2150@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: e40-008-4.mit.edu
  8. Organization: Massachusetts Institute of Technology
  9. Date: Thu, 20 Aug 1992 03:19:46 GMT
  10. Lines: 22
  11.  
  12. I was wondering if there is an absolute method of determining if a
  13. file is open for writing. I have been doing:
  14.  
  15. ls -s foo > tmp1
  16. sleep 5
  17. ls -s foo > tmp2
  18. cmp tmp1 tmp2
  19. ...
  20.  
  21. inside of a csh script that looks for files periodically and if they
  22. have finished growing, uses them. This would work fine except that the
  23. files are coming in over the net, which causes problems when it hangs
  24. and the file doesn't grow for awhile. 
  25.  
  26. So, if anyone knows of a way to check that a file has actually been
  27. closed by whatever was writing it, please let me know.
  28.  
  29. ______________________________________________________________________________
  30. Benjy Thomas                          Do you people have any identification?
  31. benjy@athena.mit.edu                  My mother might not let me play with you.
  32. ______________________________________________________________________________
  33.  
  34.