Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2018-05-27 04:11 GMT
Find Nodes?
    Voting Booth?