SFTCLIENT - ReadDirectory - filter

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
varlau
Posts: 2
Joined: Fri 10 Apr 2020 07:58

SFTCLIENT - ReadDirectory - filter

Post by varlau » Fri 10 Apr 2020 08:09

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.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTCLIENT - ReadDirectory - filter

Post by ViktorV » Fri 10 Apr 2020 10:01

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.

varlau
Posts: 2
Joined: Fri 10 Apr 2020 07:58

Re: SFTCLIENT - ReadDirectory - filter

Post by varlau » Fri 10 Apr 2020 11:37

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).

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTCLIENT - ReadDirectory - filter

Post by ViktorV » Fri 10 Apr 2020 12:17

Thank you for interest to our product.
Feel free to contact us if you have any further questions about our products.

Post Reply