1Net::SSH2::SFTP(3) User Contributed Perl Documentation Net::SSH2::SFTP(3)
2
3
4
6 Net::SSH2::SFTP - SSH 2 Secure FTP object
7
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 open ( file [, flags [, mode ]]] )
17 Open or create a file on the remote host. The flags are the standard
18 O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, and O_EXCL,
19 which may be combined as usual. Flags default to O_RDONLY and mode to
20 0666 (create only). Returns a Net::SSH2::File object on success.
21
22 opendir ( dir )
23 Open a directory on the remote host; returns a Net::SSH2::Dir object on
24 success.
25
26 unlink ( file )
27 Delete the remote file.
28
29 rename ( old, new [, flags ] )
30 Rename old to new. Flags are taken from LIBSSH2_SFTP_RENAME_*, and may
31 be combined; the default is to use all (overwrite, atomic, native).
32
33 mkdir ( path [, mode ] )
34 Create directory; mode defaults to 0777.
35
36 rmdir ( path )
37 Remove directory.
38
39 stat ( path [, follow ] )
40 Get file attributes for the given path. If follow is set (default),
41 will follow symbolic links. On success, returns a hash containing the
42 following:
43
44 mode
45 size
46 uid
47 gid
48 atime
49 mtime
50
51 setstat ( path, key, value... )
52 Set file attributes for given path; keys are the same as those returned
53 by stat; note that it's not necessary to pass them all.
54
55 symlink ( path, target [, type ] )
56 Create a symbolic link to a given target.
57
58 readlink ( path )
59 Return the target of the given link, undef on failure.
60
61 realpath ( path )
62 Resolve a filename's path; returns the resolved path, or undef on
63 error.
64
66 Net::SSH2.
67
69 David B. Robins, <dbrobins@cpan.org>
70
72 Copyright (C) 2005, 2006 by David B. Robins; all rights reserved.
73
74 This library is free software; you can redistribute it and/or modify it
75 under the same terms as Perl itself, either Perl version 5.8.0 or, at
76 your option, any later version of Perl 5 you may have available.
77
78
79
80perl v5.12.3 2007-02-24 Net::SSH2::SFTP(3)