Subject: | Net::FTP not seek'ing to the start of a file, breaks multiple transfers |
Hi,
seems Net::FTP doesn't seek to the start of file before transferring it.
I noticed this when I wanted to upload the same file, consecutively, to
two different FTP servers. On the second server, the file always showed
up with "0 bytes".
I fixed this by adding a
seek($loc, 0, 0);
just before the while(1) loop starting at line 746 of FTP.pm
This affects at least versions 1.16 (which I used when noticing the bug)
to 1.22 (to which I upgraded).
Not sure if it's important, but the file in question was created using
File::Temp and I did not open a file handle pointing to it at the time
of the transfer.
Environment info:
perl -v: This is perl, v5.8.0 built for sun4-solaris
uname -a: SunOS csdatamart01 5.8 Generic_117350-45 sun4u sparc
SUNW,Sun-Fire-880
Best regards
Jochen