Skip to content

Commit faa948c

Browse files
author
Pan
committed
Implemented sftp realpath method.
Added SFTP attribute properties and methods. Updated SFTP *stat* functions to return attributes object, added raising exceptions on errors. Updated SFTP symlink function. Added SFTP stat, realpath, symlink and *stat* integration tests. Added SFTP file types and macros to definition file.
1 parent 088b66f commit faa948c

File tree

9 files changed

+3391
-1049
lines changed

9 files changed

+3391
-1049
lines changed

ssh2/agent.c

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/c_sftp.pxd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ cdef extern from "libssh2_sftp.h" nogil:
4242
uint64_t f_fsid # file system ID
4343
uint64_t f_flag # mount flags
4444
uint64_t f_namemax # maximum filename length
45+
# SFTP File types
46+
enum:
47+
LIBSSH2_SFTP_S_IFMT # type of file mask
48+
LIBSSH2_SFTP_S_IFIFO # named pipe (fifo)
49+
LIBSSH2_SFTP_S_IFCHR # character special
50+
LIBSSH2_SFTP_S_IFDIR # directory
51+
LIBSSH2_SFTP_S_IFBLK # block special
52+
LIBSSH2_SFTP_S_IFREG # regular
53+
LIBSSH2_SFTP_S_IFLNK # symbolic link
54+
LIBSSH2_SFTP_S_IFSOCK # socket
4555
# SFTP File Transfer Flags
4656
enum:
4757
LIBSSH2_FXF_READ
@@ -67,6 +77,13 @@ cdef extern from "libssh2_sftp.h" nogil:
6777
LIBSSH2_SFTP_S_IROTH # R for other
6878
LIBSSH2_SFTP_S_IWOTH # W for other
6979
LIBSSH2_SFTP_S_IXOTH # X for other
80+
int LIBSSH2_SFTP_S_ISLNK(unsigned long m)
81+
int LIBSSH2_SFTP_S_ISREG(unsigned long m)
82+
int LIBSSH2_SFTP_S_ISDIR(unsigned long m)
83+
int LIBSSH2_SFTP_S_ISCHR(unsigned long m)
84+
int LIBSSH2_SFTP_S_ISBLK(unsigned long m)
85+
int LIBSSH2_SFTP_S_ISFIFO(unsigned long m)
86+
int LIBSSH2_SFTP_S_ISSOCK(unsigned long m)
7087
LIBSSH2_SFTP *libssh2_sftp_init(LIBSSH2_SESSION *session)
7188
int libssh2_sftp_shutdown(LIBSSH2_SFTP *sftp)
7289
unsigned long libssh2_sftp_last_error(LIBSSH2_SFTP *sftp)

ssh2/channel.c

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)