FTP: NSLT
The situation with NLST seems to be clear and unambiguous ... but is not. Imagine the following command:
NSLT dir
some servers respond with something like this
file1
file2
while other servers respond with different output
dir/file1
dir/file2
FTP: GetNameList + GetFileSize
GetNameList
works almost universally. GetFileSize
is not supported by some FTP servers. And in some FTP servers the SIZE commands returns 0 for directories (so it's hard to decide whether a FTP item is file or directory).
SFTP: GetNameList, GetList and GetRawList
There is only one method for getting a directory content in the SFTP protocol. Those three methods are provided only for convenience and in order to have API similar to FTP component.
Best way how to get a directory list
FTP:
The best way would be calling Ftp.GetList()
and let the parser handle all problems. If the format cannot be parsed then call the Ftp.GetRawList
and mail the output to support@rebex.net. We'll be happy to enhance the built-in parser so it can handle this new format.
You can also subscribe to FtpItem.ItemParse event and provide your own parser. Sample parser which processes *nix access rights can be found in Rebex FTP Console Client sample.
SFTP:
Sftp.GetList() should work everywhere.
Applies to: