Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: FTP & MD5

by bofh_of_oz (Hermit)
on Jun 21, 2005 at 13:42 UTC ( #468670=note: print w/ replies, xml ) Need Help??


in reply to FTP & MD5

Note: your script shouldn't work as is, because $ftp->get needs a single file name as argument, while you're giving a wildcard. That means you need to find out the exact name of the file to transfer, before the transfer. One way to do so is:

my @files=$ftp->ls or $error=1; $ftp->quit if $error; foreach(@files) { if (/^yourRegex/i) #Filter file names { print "$_\n"; unshift @match, $_; } } defined $match[0] ? $fname = $match[0] : $ftp->quit;

So you list the files, and grab the filenames... Then you download the files... Then you run MD5 on them.

On the server side, you can run MD5 on the files on a schedule, or "upon arrival"; then you transfer MD5 file as well and match it to your local result - voila!

Hope this helps...

--------------------------------
An idea is not responsible for the people who believe in it...


Comment on Re: FTP & MD5
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-27 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls