Page 1 of 1

using file masks in SFTPClient

Posted: Mon 05 Feb 2018 17:08
by mpsuer
Hi,

ist it possible to use a filemask when requesting a directory content with the sftpclient component or do I have to read a whole directory and do the filtering for the filenames which I want to use by myself?

Code: Select all

// this works as expected
dirHandle := ScSFTPClient.OpenDirectory('/');

// providing a filter mask doesn't work
dirHandle := ScSFTPClient.OpenDirectory('/x12*.txt');
kind regards
Martin

Re: using file masks in SFTPClient

Posted: Wed 07 Feb 2018 10:38
by ViktorV
SFTP protocol does not allow using a mask to read the required files. To solve your task, you should use the TScSFTPClient.OnDirectoryList event handler. You can get a sample of how to use it on our forum: viewtopic.php?t=34304. If after getting acquainted, you have any specific questions left, or if new ones arise, please ask and we will answer them.