home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!panther!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
- From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
- Subject: Re: Testing if a file is closed?
- Message-ID: <mcook.724094539@fendahl.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fendahl.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- References: <GLEWIS.92Dec9114722@fws204.intel.com> <mcook.724004050@fendahl.dev.cdx.mot.com> <1992Dec11.111959.27875@cs.ruu.nl>
- Distribution: comp
- Date: Fri, 11 Dec 1992 17:22:19 GMT
- Lines: 33
-
- piet@cs.ruu.nl (Piet van Oostrum) writes:
-
- >>>>>> mcook@fendahl.dev.cdx.mot.com (Michael Cook) (MC) writes:
-
- >MC> glewis@pcocd2.intel.com (Glenn M. Lewis - ICD ~) writes:
-
- >> I'm afraid I can't figure out from the book or reference guide
- >>how to test whether or not a file is closed. Sorry if this is a silly
- >>question.
-
- >> Here is my situation... Some other machine is writing into a
- >>directory that my Perl script is scanning for files. My script needs
- >>to know when the other machine has closed the file after it finishes
- >>writing to it. I have zero control over the other machine, so I can't
- >>make it create any other synchronizing files, such as "file.lock" and
- >>then removing it when finished. I must determine in my script when
- >>the file in question is complete and closed to writing. Is this
- >>possible from Perl?
-
- >MC> Whether it is possible is dependent on your operating system. In
- >MC> general, I don't think Unixes will let you know whether some other
- >MC> process has a file open.
-
- >The way this should be done is that the PRODUCERS of the files should
- >create a temp file first, on the same disk partition, and when the file is
- >complete and closed, rename it so that the spooler will recognize it.
-
- Yes, that's a reasonable solution ...except that Glenn originally said this:
-
- >>I have zero control over the other machine, so I can't make it create any
- >>other synchronizing files,
-
- Michael.
-