Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: automated file move

by pfaut (Priest)
on Dec 18, 2007 at 00:33 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-19 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found