1Net::SSH2::SFTP(3)    User Contributed Perl Documentation   Net::SSH2::SFTP(3)
2
3
4

NAME

6       Net::SSH2::SFTP - SSH 2 Secure FTP object
7

DESCRIPTION

9       An SFTP object is created by the Net::SSH2 "sftp" method.
10
11   error
12       Returns the last SFTP error (one of the LIBSSH2_FX_* constants).  Use
13       this when Net::SSH2::error returns LIBSSH2_ERROR_SFTP_PROTOCOL.  In
14       list context, returns (code, error name).
15
16   die_with_error( [message] )
17       Calls "die" with the given message and the error information from the
18       object appended.
19
20   open ( file [, flags [, mode ]]] )
21       Open or create a file on the remote host.  The flags are the standard
22       O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, and O_EXCL,
23       which may be combined as usual.  Flags default to O_RDONLY and mode to
24       0666 (create only).  Returns a Net::SSH2::File object on success.
25
26   opendir ( dir )
27       Open a directory on the remote host; returns a Net::SSH2::Dir object on
28       success.
29
30   unlink ( file )
31       Delete the remote file.
32
33   rename ( old, new [, flags ] )
34       Rename old to new.  Flags are taken from LIBSSH2_SFTP_RENAME_*, and may
35       be combined; the default is to use all (overwrite, atomic, native).
36
37   mkdir ( path [, mode ] )
38       Create directory; mode defaults to 0777.
39
40   rmdir ( path )
41       Remove directory.
42
43   stat ( path [, follow ] )
44       Get file attributes for the given path.  If follow is set (default),
45       will follow symbolic links.  On success, returns a hash containing the
46       following:
47
48       mode
49       size
50       uid
51       gid
52       atime
53       mtime
54
55   setstat ( path, key, value... )
56       Set file attributes for given path; keys are the same as those returned
57       by stat; note that it's not necessary to pass them all.
58
59   symlink ( path, target [, type ] )
60       Create a symbolic link to a given target.
61
62   readlink ( path )
63       Return the target of the given link, undef on failure.
64
65   realpath ( path )
66       Resolve a filename's path; returns the resolved path, or undef on
67       error.
68

SEE ALSO

70       Net::SSH2.
71
72       Check Net::SFTP::Foreign for a high level, perlish and easy to use SFTP
73       client module. It can work on top of Net::SSH2 via the
74       Net::SFTP::Foreign::Backend::Net_SSH2 backend module.
75

AUTHOR

77       David B. Robins, <dbrobins@cpan.org>
78
80       Copyright (C) 2005, 2006 by David B. Robins; all rights reserved.
81
82       This library is free software; you can redistribute it and/or modify it
83       under the same terms as Perl itself, either Perl version 5.8.0 or, at
84       your option, any later version of Perl 5 you may have available.
85
86
87
88perl v5.34.0                      2022-01-21                Net::SSH2::SFTP(3)
Impressum