.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "TFTP 3pm" .TH TFTP 3pm "2010-11-25" "perl v5.10.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::TFTP \- TFTP Client class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::TFTP; \& \& $tftp = Net::TFTP\->new("some.host.name", BlockSize => 1024); \& \& $tftp\->ascii; \& \& $tftp\->get("remotefile", "localfile"); \& \& $tftp\->get("remotefile", \e*STDOUT); \& \& $fh = $tftp\->get("remotefile"); \& \& $tftp\->binary; \& \& $tftp\->put("localfile", "remotefile"); \& \& $tftp\->put(\e*STDOUT, "remotefile"); \& \& $fh = $tftp\->put("remotefile"); \& \& $err = $tftp\->error .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Net::TFTP\*(C'\fR is a class implementing a simple \fITrivial File Transfer Protocol\fR client in Perl as described in \s-1RFC1350\s0. \f(CW\*(C`Net::TFTP\*(C'\fR also supports the \&\s-1TFTP\s0 Option Extension (as described in \s-1RFC2347\s0), with the following options .PP .Vb 1 \& RFC2348 Blocksize Option .Ve .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .IP "new ( [ \s-1HOST\s0 ] [, \s-1OPTIONS\s0 ])" 4 .IX Item "new ( [ HOST ] [, OPTIONS ])" Create a new Net::TFTP object where \s-1HOST\s0 is the default host to connect to and \s-1OPTIONS\s0 are the default transfer options. Valid options are .Sp .Vb 8 \& 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" .Ve .SH "METHODS" .IX Header "METHODS" .IP "get ( \s-1REMOTE_FILE\s0 [, \s-1LOCAL\s0 ] [, \s-1OPTIONS\s0 ])" 4 .IX Item "get ( REMOTE_FILE [, LOCAL ] [, OPTIONS ])" Get \s-1REMOTE_FILE\s0 from the server. \s-1OPTIONS\s0 can be any that are accepted by \&\f(CW\*(C`new\*(C'\fR plus the following .Sp .Vb 1 \& Host Override default host .Ve .Sp If the \s-1LOCAL\s0 option is missing the get will return a filehandle. This filehandle must be read \s-1ASAP\s0 as the server will otherwise timeout. .Sp If the \s-1LOCAL\s0 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. \f(CW\*(C`get\*(C'\fR will return \fItrue\fR if the transfer is successful and \&\fIundef\fR otherwise. .Sp Valid filehandles are .RS 4 .IP "\(bu" 4 A sub-class of IO::Handle .IP "\(bu" 4 A tied filehandle .IP "\(bu" 4 A \s-1GLOB\s0 reference (eg \f(CW\*(C`\e*STDOUT\*(C'\fR) .RE .RS 4 .RE .IP "put ( [ \s-1LOCAL\s0, ] \s-1REMOTE_FILE\s0 [, \s-1OPTIONS\s0])" 4 .IX Item "put ( [ LOCAL, ] REMOTE_FILE [, OPTIONS])" Put a file to the server as \s-1REMOTE_FILE\s0. \s-1OPTIONS\s0 can be any that are accepted by \f(CW\*(C`new\*(C'\fR plus the following .Sp .Vb 1 \& Host Override default host .Ve .Sp If the \s-1LOCAL\s0 option is missing the put will return a filehandle. This filehandle must be written to \s-1ASAP\s0 as the server will otherwise timeout. .Sp If the \s-1LOCAL\s0 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. \&\f(CW\*(C`put\*(C'\fR will return \fItrue\fR if the transfer is successful and \fIundef\fR otherwise. .IP "error" 4 .IX Item "error" If there was an error then this method will return an error string. .IP "host ( [ \s-1HOST\s0 ] )" 4 .IX Item "host ( [ HOST ] )" .PD 0 .IP "timeout ( [ \s-1TIMEOUT\s0 ] )" 4 .IX Item "timeout ( [ TIMEOUT ] )" .IP "port ( [ \s-1PORT\s0 ] )" 4 .IX Item "port ( [ PORT ] )" .IP "mode ( [ \s-1MODE\s0 ] )" 4 .IX Item "mode ( [ MODE ] )" .IP "retries ( [ \s-1VALUE\s0 ] )" 4 .IX Item "retries ( [ VALUE ] )" .IP "block_size ( [ \s-1VALUE\s0 ] )" 4 .IX Item "block_size ( [ VALUE ] )" .IP "debug ( [ \s-1VALUE\s0 ] )" 4 .IX Item "debug ( [ VALUE ] )" .PD Set or get the values for the various options. If an argument is passed then a new value is set for that option and the previous value returned. If no value is passed then the current value is returned. .IP "ip_mode ( [ \s-1VALUE\s0 ] )" 4 .IX Item "ip_mode ( [ VALUE ] )" Set or get which verion of \s-1IP\s0 to use (\*(L"v4\*(R" or \*(L"v6\*(R") .IP "ascii" 4 .IX Item "ascii" .PD 0 .IP "netascii" 4 .IX Item "netascii" .PD Set the transfer mode to \f(CW"netascii"\fR .IP "binary" 4 .IX Item "binary" .PD 0 .IP "octet" 4 .IX Item "octet" .PD Set the transfer mode to \f(CW"octet"\fR .SH "AUTHOR" .IX Header "AUTHOR" Graham Barr .SH "COPYRIGHT" .IX Header "COPYRIGHT" 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.