Open the specified directory on an FTP server.
- An optional string value that specifies the directory on the
server. If it is an empty string, it designates the current
remote directory. It may also be a file mask that includes wildcards
if supported by the server. If this argument is omitted, then the
current working directory will be opened.
- An optional boolean value that determines if the directory
listing will be parsed as it is read. The default value is true. If
the ParseList parameter is
false, then each entire un-parsed line of a directory listing will be
returned in the FileName parameter of the ReadDirectory
method, and all other output parameters will be empty.
A value of zero is returned if the method succeeds. Otherwise,
a non-zero error code is returned which indicates the cause of the
The OpenDirectory method opens the specified directory on
the server so that the list of files in that directory may be
Note that you must call the CloseDirectory method after the
list of files has been returned by the server. Failure to do so will
result in an error when you attempt to transfer a file because the
data channel to the server has been left open. For this same reason,
you cannot call the GetFile or PutFile methods while
reading the contents of a directory on the server.
nError = FileTransfer1.OpenDirectory(strDirName)
nError = FileTransfer1.OpenDirectory()
nError = FileTransfer1.OpenDirectory("", False)
nError = FileTransfer1.OpenDirectory("*.exe")