ResolvePath Event
Fires when a client attempts to canonicalize a path.
Syntax
[VB.NET] Public Event OnResolvePath As OnResolvePathHandler
[C#] public event OnResolvePathHandler OnResolvePath; public delegate void OnResolvePathHandler(object sender, SftpserverResolvePathEventArgs e); class SftpserverResolvePathEventArgs : EventArgs { int ConnectionId {get;} string User {get;} string OriginalPath {get;} int ControlFlags {get;} string RealPath {get; set;} int StatusCode {get; set;} }
Remarks
The ResolvePath event fires when an SFTP client sends an SSH_FXP_REALPATH request. The OriginalPath parameter will contain the path the client wants to canonicalize. ControlFlags can have one of the following values:
SSH_FXP_REALPATH_NO_CHECK (0x00000001) | Server should not check if the path exists. |
SSH_FXP_REALPATH_STAT_IF (0x00000002) | Server should return the file/directory attributes if the path exists and is accessible, but should not fail otherwise. |
SSH_FXP_REALPATH_STAT_ALWAYS (0x00000003) | Server should return the file/directory attributes if the path exists and is accessible, otherwise fail with an error. |
RealPath should be set to the resulting canonicalized path, and StatusCode should be set to indicate success or failure of the operation to the client.
Valid status codes are:
- SSH_FX_OK 0
- SSH_FX_EOF 1
- SSH_FX_NO_SUCH_FILE 2
- SSH_FX_PERMISSION_DENIED 3
- SSH_FX_FAILURE 4
- SSH_FX_BAD_MESSAGE 5
- SSH_FX_NO_CONNECTION 6
- SSH_FX_CONNECTION_LOST 7
- SSH_FX_OP_UNSUPPORTED 8
- SSH_FX_INVALID_HANDLE 9
- SSH_FX_NO_SUCH_PATH 10
- SSH_FX_FILE_ALREADY_EXISTS 11
- SSH_FX_WRITE_PROTECT 12
- SSH_FX_NO_MEDIA 13
- SSH_FX_NO_SPACE_ON_FILESYSTEM 14
- SSH_FX_QUOTA_EXCEEDED 15
- SSH_FX_UNKNOWN_PRINCIPAL 16
- SSH_FX_LOCK_CONFLICT 17
- SSH_FX_DIR_NOT_EMPTY 18
- SSH_FX_NOT_A_DIRECTORY 19
- SSH_FX_INVALID_FILENAME 20
- SSH_FX_LINK_LOOP 21
- SSH_FX_CANNOT_DELETE 22
- SSH_FX_INVALID_PARAMETER 23
- SSH_FX_FILE_IS_A_DIRECTORY 24
- SSH_FX_BYTE_RANGE_LOCK_CONFLICT 25
- SSH_FX_BYTE_RANGE_LOCK_REFUSED 26
- SSH_FX_DELETE_PENDING 27
- SSH_FX_FILE_CORRUPT 28
- SSH_FX_OWNER_INVALID 29
- SSH_FX_GROUP_INVALID 30
- SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK 31