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.
 
 
 
 

80 lines
2.7 KiB

  1. .TH libssh2_sftp_symlink_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
  2. .SH NAME
  3. libssh2_sftp_symlink_ex - read or set a symbolic link
  4. .SH SYNOPSIS
  5. .nf
  6. #include <libssh2.h>
  7. #include <libssh2_sftp.h>
  8. int
  9. libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp, const char *path,
  10. unsigned int path_len, char *target,
  11. unsigned int target_len, int link_type);
  12. .SH DESCRIPTION
  13. Create a symlink or read out symlink information from the remote side.
  14. \fIsftp\fP - SFTP instance as returned by
  15. .BR libssh2_sftp_init(3)
  16. \fIpath\fP - Remote filesystem object to create a symlink from or resolve.
  17. \fIpath_len\fP - Length of the name of the remote filesystem object to
  18. create a symlink from or resolve.
  19. \fItarget\fP - a pointer to a buffer. The buffer has different uses depending
  20. what the \fIlink_type\fP argument is set to.
  21. .br
  22. \fBLIBSSH2_SFTP_SYMLINK\fP: Remote filesystem object to link to.
  23. .br
  24. \fBLIBSSH2_SFTP_READLINK\fP: Pre-allocated buffer to resolve symlink target
  25. into.
  26. .br
  27. \fBLIBSSH2_SFTP_REALPATH\fP: Pre-allocated buffer to resolve realpath target
  28. into.
  29. \fItarget_len\fP - Length of the name of the remote filesystem target object.
  30. \fIlink_type\fP - One of the three previously mentioned constants which
  31. determines the resulting behavior of this function.
  32. These are convenience macros:
  33. .BR libssh2_sftp_symlink(3)
  34. : Create a symbolic link between two filesystem objects.
  35. .br
  36. .BR libssh2_sftp_readlink(3)
  37. : Resolve a symbolic link filesystem object to its next target.
  38. .br
  39. .BR libssh2_sftp_realpath(3)
  40. : Resolve a complex, relative, or symlinked filepath to its effective target.
  41. .SH RETURN VALUE
  42. When using LIBSSH2_SFTP_SYMLINK, this function returns 0 on success or negative
  43. on failure.
  44. When using LIBSSH2_SFTP_READLINK or LIBSSH2_SFTP_REALPATH, it returns the
  45. number of bytes it copied to the target buffer (not including the terminating
  46. zero) or negative on failure.
  47. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
  48. LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
  49. From 1.2.8, LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if the given 'target'
  50. buffer is too small to fit the requested object name.
  51. .SH BUG
  52. Passing in a too small buffer when receiving data only results in libssh2
  53. 1.2.7 or earlier to not copy the entire data amount, and it is not possible
  54. for the application to tell when it happens!
  55. .SH ERRORS
  56. \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
  57. \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
  58. \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
  59. \fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
  60. received on the socket, or an SFTP operation caused an errorcode to
  61. be returned by the server.
  62. .SH SEE ALSO
  63. .BR libssh2_sftp_init(3)