.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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" '' . ds C` . ds C' '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 >0, 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. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::SSH2::SFTP 3pm" .TH Net::SSH2::SFTP 3pm "2021-01-03" "perl v5.32.0" "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::SSH2::SFTP \- SSH 2 Secure FTP object .SH "DESCRIPTION" .IX Header "DESCRIPTION" An \s-1SFTP\s0 object is created by the Net::SSH2 \f(CW\*(C`sftp\*(C'\fR method. .SS "error" .IX Subsection "error" Returns the last \s-1SFTP\s0 error (one of the LIBSSH2_FX_* constants). Use this when Net::SSH2::error returns \s-1LIBSSH2_ERROR_SFTP_PROTOCOL.\s0 In list context, returns (code, error name). .SS "die_with_error( [message] )" .IX Subsection "die_with_error( [message] )" Calls \f(CW\*(C`die\*(C'\fR with the given message and the error information from the object appended. .SS "open ( file [, flags [, mode ]]] )" .IX Subsection "open ( file [, flags [, mode ]]] )" Open or create a file on the remote host. The flags are the standard O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, and O_EXCL, which may be combined as usual. Flags default to O_RDONLY and mode to 0666 (create only). Returns a Net::SSH2::File object on success. .SS "opendir ( dir )" .IX Subsection "opendir ( dir )" Open a directory on the remote host; returns a Net::SSH2::Dir object on success. .SS "unlink ( file )" .IX Subsection "unlink ( file )" Delete the remote file. .SS "rename ( old, new [, flags ] )" .IX Subsection "rename ( old, new [, flags ] )" Rename old to new. Flags are taken from LIBSSH2_SFTP_RENAME_*, and may be combined; the default is to use all (overwrite, atomic, native). .SS "mkdir ( path [, mode ] )" .IX Subsection "mkdir ( path [, mode ] )" Create directory; mode defaults to 0777. .SS "rmdir ( path )" .IX Subsection "rmdir ( path )" Remove directory. .SS "stat ( path [, follow ] )" .IX Subsection "stat ( path [, follow ] )" Get file attributes for the given path. If follow is set (default), will follow symbolic links. On success, returns a hash containing the following: .IP "mode" 4 .IX Item "mode" .PD 0 .IP "size" 4 .IX Item "size" .IP "uid" 4 .IX Item "uid" .IP "gid" 4 .IX Item "gid" .IP "atime" 4 .IX Item "atime" .IP "mtime" 4 .IX Item "mtime" .PD .SS "setstat ( path, key, value... )" .IX Subsection "setstat ( path, key, value... )" Set file attributes for given path; keys are the same as those returned by stat; note that it's not necessary to pass them all. .SS "symlink ( path, target [, type ] )" .IX Subsection "symlink ( path, target [, type ] )" Create a symbolic link to a given target. .SS "readlink ( path )" .IX Subsection "readlink ( path )" Return the target of the given link, undef on failure. .SS "realpath ( path )" .IX Subsection "realpath ( path )" Resolve a filename's path; returns the resolved path, or undef on error. .SH "SEE ALSO" .IX Header "SEE ALSO" Net::SSH2. .PP Check Net::SFTP::Foreign for a high level, perlish and easy to use \&\s-1SFTP\s0 client module. It can work on top of Net::SSH2 via the Net::SFTP::Foreign::Backend::Net_SSH2 backend module. .SH "AUTHOR" .IX Header "AUTHOR" David B. Robins, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2005, 2006 by David B. Robins; all rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.