| David Jacopille 2005-03-24, 3:56 am |
| I'm looking for some strategies to determine when other applications
are finished writing a file. I've got a script printing page layout
files to postscript in rapid fashion. I'd like to move the postscript
to another location for some additional modifications as fast as
possible. I can't figure out how to have my perl script NOT move those
postscript files that are in the process of being written.
I've tried checking the -w status but that seems to check the files
permissions settings which apparently are writable even if while the
file is being actively written by the page layout app. I've tried last
access time > 2 seconds or modification date > 2 seconds but those
don't quite seem to work.
Opening a filehandle for writing seems to give an error if the file is
still being written - is that the best way?
Isn't there a very direct way to ask if a file is not in the middle of
being written by any other process?
Thanks,
Dave
|