TFTP(3pm) | User Contributed Perl Documentation | TFTP(3pm) |
Net::TFTP - TFTP Client class
use Net::TFTP; $tftp = Net::TFTP->new("some.host.name", BlockSize => 1024); $tftp->ascii; $tftp->get("remotefile", "localfile"); $tftp->get("remotefile", \*STDOUT); $fh = $tftp->get("remotefile"); $tftp->binary; $tftp->put("localfile", "remotefile"); $tftp->put(\*STDOUT, "remotefile"); $fh = $tftp->put("remotefile"); $err = $tftp->error
"Net::TFTP" is a class implementing a simple Trivial File Transfer Protocol client in Perl as described in RFC1350. "Net::TFTP" also supports the TFTP Option Extension (as described in RFC2347), with the following options
RFC2348 Blocksize Option
Option Description Default ------ ----------- ------- Timeout Timeout in seconds before retry 5 Retries Maximum number of retries 5 Port Port to send data to 69 Mode Mode to transfer data in, "octet" or "netascii" "netascii" BlockSize Negotiate size of blocks to use in the transfer 512 IpMode Indicates whether to operate in IPv6 mode "v4"
Host Override default host
If the LOCAL option is missing the get will return a filehandle. This filehandle must be read ASAP as the server will otherwise timeout.
If the LOCAL option is given then it can be a file name or a reference. If it is a reference it is assumed to be a reference that is valid as a filehandle. "get" will return true if the transfer is successful and undef otherwise.
Valid filehandles are
Host Override default host
If the LOCAL option is missing the put will return a filehandle. This filehandle must be written to ASAP as the server will otherwise timeout.
If the LOCAL option is given then it can be a file name or a reference. If it is a reference it is assumed to be a valid filehandle as described above. "put" will return true if the transfer is successful and undef otherwise.
Graham Barr <gbarr@pobox.com>
Copyright (c) 1998,2007 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2022-10-13 | perl v5.36.0 |