Archived Forum Post

Index of archived forum posts


sftp wildcard in Cocoa

Aug 23 '12 at 04:59

Hi Everyone,

Is there any kind of wildcard when downloading using sftp. Something like that:

BOOL success = [sftp DownloadFileByName:@"/home/user/*.txt" localFilePath:@"/mydir"];



I'm sorry to say that using a wildcard like you've described will not work.

To download all files matching a pattern such as "*.txt", you would write code that iterates over the files in a directory, such as shown here:

and then within the loop, call DownloadFileByName for each filename that matches your pattern.