Page 1 of 1

SFTCLIENT - ReadDirectory - filter

Posted: Fri 10 Apr 2020 08:09
by varlau
Hi,

I try to use TscSFTPClient and I want to use ReadDirectory method to get file list of a directory.
But, I would like specify filter as that : 'A*.prn' before launch ReadDirectory.
Is it possible ? In which property or method ?

I ask that because there are many files in my directory and I want to set a filter for getting only the files of a user (the user's initials are in filename).

Thank's in advance for your response.

Have a nice day.

Laurent.

Re: SFTCLIENT - ReadDirectory - filter

Posted: Fri 10 Apr 2020 10:01
by ViktorV
Filtering cannot be implemented at the SFTP protocol level, so you'll always receive the full list of files, whereas on the client side, you can implement filtering.
To accomplish your task, you should use the event handler TScSFTPClient.OnDirectoryList.
Refer to our documentation for more information about using the TScSFTPClient.OnDirectoryList event handler: https://www.devart.com/sbridge/docs/tsc ... rylist.htm. You may also explore our demo project SFTPClient, which is located in the %SecureBridgeDemos%\SFTPClient directory, where %SecureBridgeDemos% is the SecureBridge Demo projects installation path on your computer.

Re: SFTCLIENT - ReadDirectory - filter

Posted: Fri 10 Apr 2020 11:37
by varlau
Thank's a lot.

I was afraid of a response as that :(

Ok for the demo project I've already looked at.

Have a nice day and stay at home !

Laurent (from France).

Re: SFTCLIENT - ReadDirectory - filter

Posted: Fri 10 Apr 2020 12:17
by ViktorV
Thank you for interest to our product.
Feel free to contact us if you have any further questions about our products.