SocketTools .NET Edition

FtpClient.OpenDirectory Method (String)

Open the specified directory on the server.

[Visual Basic]
Overloads Public Function OpenDirectory( _
   ByVal pathName As String _
) As Boolean
[C#]
public bool OpenDirectory(
   string pathName
);

Parameters

pathName
A string that specifies the name of the directory to open on the server. The naming and pathing conventions used for the directory must be compatible with what is used on the operating system that hosts the server.

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 OpenDirectory method opens the specified directory on the server so that the list of files in that directory may be obtained using the GetFirstFile and GetNextFile methods. Once all of the files in the directory have been read, the application must call the CloseDirectory method in order to close the data channel to the server. Failure to do this will result in an error the next time the application attempts to transfer a file or open another directory.

Note that files and directories on UNIX based systems are case sensitive, so the directory names "Projects" and "projects" refer to two different directories. This is not the case on Windows systems, where either name would refer to the same directory.

See Also

FtpClient Class | SocketTools Namespace | FtpClient.OpenDirectory Overload List