Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: how to tell if a file is still being modified

by nimdokk (Vicar)
on Sep 15, 2003 at 20:26 UTC ( #291644=note: print w/replies, xml ) Need Help??

in reply to how to tell if a file is still being modified

FTP does not lock files when it is still writing to them (I've run into this issue already where a 500 Mbyte file was being uploaded and our process picked it up and moved it on to another location before it had completed the upload). Our solution in that case was to have to sender create a "lock" file once they had completed transmitting the file to us. The lock file is usually very small (0-byte preferrably) that was we look for the lock file and then perform the actions we need on the other file. It might not be the cleanest solution, but it seems to work.

"Ex libris un peut de tout"
  • Comment on Re: how to tell if a file is still being modified

Replies are listed 'Best First'.
Re^2: how to tell if a file is still being modified
by PhilHibbs (Hermit) on Sep 16, 2003 at 10:47 UTC
    As there is no reliable cross-platform file locking system, flag files are a common pattern for indicating process state. I worked with a system that had directories called "do", "done", "pending", "success", and "fail". The actual data file was dropped in the "pending" directory, then a file of the same name was created in the "do" directory. When the file transfer subsystem had done the transfer, it moved the "pending" file to "success", and moved the marker file from "do" to "done".

    Can you get the sending process to create a marker file (either with an extension, a prefix, or in another directory) to indicate completion, and monitor for the marker instead?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://291644]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-05-21 11:24 GMT
Find Nodes?
    Voting Booth?