[Melbourne-pm] Strange behaviour from Net::TFTP
lsharpe at pacificwireless.com.au
Thu Oct 16 18:30:05 PDT 2008
I'm seeing what I consider to be odd behaviour using Net::TFTP to copy
some files to a remote machine. The part of the code giving me problems
my $ip="126.96.36.199"; # Insert IP address of
your TFTP server here.
$tftp->put("file1", "file1") or print "Problem saving file1:
$tftp->put("file2", "file2") or print "Problem saving file2:
$tftp->put("file3", "file3") or print "Problem saving file3:
$tftp->put("file4", "file4") or print "Problem saving file4:
If all 4 files exist, all is OK. However, if file3 does not exist, I get
Problem saving file3: file3: No such file or directory
Problem saving file4: file3: No such file or directory
Now, I can understand that the error message reported by $tftp->error()
contains the last error encountered, ie that file3 doesn't exist, but
there is no reason why copying file4 should fail, because it does exist.
Worse still, file4 is created on the TFTP server, but is empty. So the
non-existence of file3 is causing the copy of file4 to fail.
Anyody care to comment on why?
Should I be calling some other method in between put()'s?
I considered just DESTROYing the object after each put(), and creating a
new one, but that just seems wrong.
I could of course test for the existence of each file first, but the
docs for Net::TFTP indicate that the above should work, and I'd like to
know what I'm missing.
Network Systems Engineer
Ph +61 3 9584 8966
Mob 0408 009 502
Helpdesk 1300 300 616
email lsharpe at pacificwireless.com.au
<blocked::mailto:lsharpe at pacificwireless.com.au>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Melbourne-pm