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