Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Monitoring directory for new files

by ikegami (Patriarch)
on Jan 20, 2010 at 05:29 UTC ( [id://818372]=note: print w/replies, xml ) Need Help??


in reply to Monitoring directory for new files

If a big file happened to be created, how do I ensure that it is completely created before it is sftp-ed to the other processing server?

Create the big file in one directory, then rename it into the monitored directory. Renaming a file just edits the directory entries, so the file instantly appears in its entirely in the second directory.

You could also keep the file locked until you are done adding to it.

but I don't seem to be able to find where / how to find the filename of the newly created file.

Maybe you're suppose to read the directory's contents and compared them with what you read previously? I didn't do any research.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-18 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found