geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

75 lines
2.3 KiB

  1. .TH libssh2_sftp_stat_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
  2. .SH NAME
  3. libssh2_sftp_stat_ex - get status about an SFTP file
  4. .SH SYNOPSIS
  5. .nf
  6. #include <libssh2.h>
  7. #include <libssh2_sftp.h>
  8. int libssh2_sftp_stat_ex(LIBSSH2_SFTP *sftp, const char *path,
  9. unsigned int path_len, int stat_type,
  10. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  11. .SH DESCRIPTION
  12. \fIsftp\fP - SFTP instance as returned by
  13. .BR libssh2_sftp_init(3)
  14. \fIpath\fP - Remote filesystem object to stat/lstat/setstat.
  15. \fIpath_len\fP - Length of the name of the remote filesystem object
  16. to stat/lstat/setstat.
  17. \fIstat_type\fP - One of the three constants specifying the type of
  18. stat operation to perform:
  19. .br
  20. \fBLIBSSH2_SFTP_STAT\fP: performs stat(2) operation
  21. .br
  22. \fBLIBSSH2_SFTP_LSTAT\fP: performs lstat(2) operation
  23. .br
  24. \fBLIBSSH2_SFTP_SETSTAT\fP: performs operation to set stat info on file
  25. \fIattrs\fP - Pointer to a \fBLIBSSH2_SFTP_ATTRIBUTES\fP structure to set file
  26. metadata from or into depending on the value of stat_type.
  27. Get or Set statbuf type data on a remote filesystem object. When getting
  28. statbuf data,
  29. .BR libssh2_sftp_stat(3)
  30. will follow all symlinks, while
  31. .BR libssh2_sftp_lstat(3)
  32. will return data about the object encountered, even if that object
  33. happens to be a symlink.
  34. The LIBSSH2_SFTP_ATTRIBUTES struct looks like this:
  35. .nf
  36. struct LIBSSH2_SFTP_ATTRIBUTES {
  37. /* If flags & ATTR_* bit is set, then the value in this struct will be
  38. * meaningful Otherwise it should be ignored
  39. */
  40. unsigned long flags;
  41. libssh2_uint64_t filesize;
  42. unsigned long uid;
  43. unsigned long gid;
  44. unsigned long permissions;
  45. unsigned long atime;
  46. unsigned long mtime;
  47. };
  48. .fi
  49. .SH RETURN VALUE
  50. Returns 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN
  51. when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative
  52. number, it isn't really a failure per se.
  53. .SH ERRORS
  54. \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
  55. \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
  56. \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
  57. \fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
  58. received on the socket, or an SFTP operation caused an errorcode to
  59. be returned by the server.
  60. .SH SEE ALSO
  61. .BR libssh2_sftp_init(3)