Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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

by monktim (Friar)
on Sep 16, 2003 at 14:18 UTC ( #291826=note: print w/replies, xml ) Need Help??

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

Here is another alternative. It may be overkill for what you want to do and it involves more work but maybe its worth considering.

Instead of another FTP process putting the files in your directory, you can run a process to establish a passive mode FTP connection to the FTP server and get the files. WGET is a good utility for this and is freely available by GNU. WGET won't put a partial file in your directory, it will wait until a complete successful download to do so. It also works well on unstable connections and can do retries.

Then you can run you own FTP server on that same machine and allow access to the directory. On your final destination machine you can again use WGET. This time you can establish a passive mode connection to your FTP server to get the files.

Passive mode FTP connections allow you to get files across the network(s) securely. That is, as long as you have good firewall rules and you have good security on your FTP server.

Update I jumped the gun. I was wong about WGET not showing the file until it is complete. I tested it with a 100MB file and it got created slowly. The version of WGET I have dumps everything is gets into a single file and then creates the individual files from it. It still creates the individual files slowly and not all at once. My bad.

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

Replies are listed 'Best First'.
Re: Re: how to tell if a file is still being modified
by sandfly (Beadle) on Sep 17, 2003 at 22:16 UTC
    This doesn't really do the job - you've just shifted the problem from one machine to another. How do you know the file is ready to get?

    This is unrelated, but where possible I would recommend getting files rather than putting them. I have found it much easier to set up UATs, parallel runs and so on with this arrangement.

    I've used variations on most of the methods mentioned above:

    • polling the checksum, mod time or size;
    • trigger files;
    • trailer records;
    • renaming or moving to another directory.

    I favour trigger files. I have to admit that I've spent far more time worrying about the possible problems than actually encountering them.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-05-25 17:45 GMT
Find Nodes?
    Voting Booth?