Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
XP is just a number
 
PerlMonks  

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.
dragonchild


Comment on Re: automated file move

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-04-19 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls