Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: automated file move

by pfaut (Priest)
on Dec 18, 2007 at 00:33 UTC ( #657576=note: print w/replies, xml ) Need Help??

in reply to automated file move

I suspect you want to wait until the writing process closes the file before you copy it and are using the fact that the file isn't growing anymore to assume this has occurred. Since this is Windows, you could probably take advantage of file locking instead. If you attempt to open the file without allowing other accessors, the open should fail unless the other process has closed it. You could retry with a delay until successful.

Another option might be to use a utility like RoboCopy which should be available from one of Microsoft's download sites if it's not on your system already. It should detect locked files and exit with a status indicating whether it succeeded or not.

90% of every Perl application is already written.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://657576]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2021-01-20 13:32 GMT
Find Nodes?
    Voting Booth?