EnumerateRemoteFiles with remote path mask

Advertisement

sricharan.kalavagunta
Joined:
Posts:
2
Location:
Bangalore

EnumerateRemoteFiles with remote path mask

Remote ftp structure
1. /ParentFolder/ChildFolderA/2021-03-20/ABC/001.zip
2. /ParentFolder/ChildFolderA/2021-03-19/ABC/002.zip
3. /ParentFolder/ChildFolderA/2021-03-18/ABC/003.zip
4. /ParentFolder/ChildFolderB/2021-03-20/DEF/101.zip
5. /ParentFolder/ChildFolderB/2021-03-19/DEF/102.zip
6. /ParentFolder/ChildFolderB/2021-03-18/DEF/103.zip
4. /ParentFolder/ChildFolderC/2021-03-20/GHI/201.zip
5. /ParentFolder/ChildFolderC/2021-03-19/GHI/202.zip
6. /ParentFolder/ChildFolderC/2021-03-18/GHI/203.zip

Please share a code snippet to session.EnumerateRemoteFiles with below filtering options of remote path
1. I should be able to include multiple directories such as ChildFolderA, ChildFolderC exluding ChildFolderB. I would prefer include over exclude because my include list will be small.
2. Along with above filter, I should have an additional filter by date range i.e. when I mention 2021-03-19, it should exclude till 2021-03-18 and include directories 2021-03-19, 2021-03-20 so on.

Expected result set for above filters
1. /ParentFolder/ChildFolderA/2021-03-20/ABC/001.zip
2. /ParentFolder/ChildFolderA/2021-03-19/ABC/002.zip
3. /ParentFolder/ChildFolderC/2021-03-20/GHI/201.zip
4. /ParentFolder/ChildFolderC/2021-03-19/GHI/202.zip

Note: I use C# and WinSCP latest stable vesion.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: EnumerateRemoteFiles with remote path mask

Sorry, but this is not a code writing service. This is not even a WinSCP question. It's mere question about filtering a string list. Please try yourself and ask questions about problems you face. Though your question would be more suitable for sites like https://stackoverflow.com/. But still, you need to try yourself even before asking there.

Reply with quote

Guest

Martin, I will rephrase my request. Does EnumerateRemoteFiles of WinSCP has an option to Include/Exclude remote directories?

Reply with quote

Advertisement

You can post new topics in this forum