SocketTools .NET Edition

FtpClient.GetFilePermissions Method 

Return the access permissions for a file on the remote system.

[Visual Basic]
Public Function GetFilePermissions( _
   ByVal remoteFile As String, _
   ByRef filePerms As FtpPermissions _
) As Boolean
[C#]
public bool GetFilePermissions(
   string remoteFile,
   ref FtpPermissions filePerms
);

Parameters

remoteFile
A string that specifies the name of the file that the access permissions are to be returned for. The filename cannot contain any wildcard characters.
filePerms
An FtpPermissions enumeration value which is passed by reference and set to the file permissions when the method returns.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The GetFilePermissions method returns information about the access permissions for a specific file on the server. This method uses the STAT command to retrieve information about the specified file. If the server does not support the use of this command, an error will be returned. You can use the Features property to determine what features are available and/or enabled on the server.

Note that on some systems, the STAT command will not return information on files that contain spaces or tabs in the filename. In this case, the method will fail.

See Also

FtpClient Class | SocketTools Namespace