I need to get a list of subdirectories in an SFTP directory, so I need to know the filetypes of all the items in the directory to find which are directories. I set up my CURLSMBS instance exactly the same as shown in the “CURLS ftp directory listing with CURLSFileInfoMBS” example.
If I don’t use
d.OptionCustomRequest = "MLSD"
the program has a hard crash when executing
Dim files() As CURLSFileInfoMBS = d.FileInfos
If I do set it for MLSD, the program doesn’t crash, but the array of FileInfos is empty.
The documentation for CURLSFileInfoMBS says
“If you use OptionWildcard, you find after the transfer all CURLFileInfoMBS objects for all the files/folders found.”
but the documentation for OptionWIldcardMatch says it is only available for FTP, not SFTP. So how to get a list of directories using SFTP?