Use Net::FTP::get($remote_file, $local_file, $offset) where offset is the byte count at which you want to transfer to resume. For example if you have received a partial file, you can check how many bytes you have downloaded with -s $file, and then use that number as the offset argument to Net::FTP::get(). The remaining of the file will be appended to the local file. | [reply] [d/l] [select] |
Just a little coment about -s $file... it doesn't work as it should if you're running Windows (the file size is only updated when you close the file handle).
acid06 perl -e "print pack('h*', 16369646), scalar reverse $="
| [reply] [d/l] |
For sending data, i have used the Net::FTP append function, along with seek(), but i have still come up with currupt data in some cases. But, usually, it works ok. With getting data, i have never used it, but an interesting problem ... hmmm.
can't sleep clowns will eat me
-- MZSanford
| [reply] [d/l] [select] |
You should be aware that it is not unusual for data in the end of a file, whose transfer went wrong is corrupt. So after you have figured out how large your already downloaded file is (with -s) subtract 4k (works best IMO) to throw away data that is likely to be corrupt. And then resume your file transfer.
T
I
M
T
O
W
T
D
I | [reply] |
| [reply] [d/l] |