Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter multiple types of files #793

Open
desolate-planet opened this issue Sep 4, 2023 · 2 comments
Open

Filter multiple types of files #793

desolate-planet opened this issue Sep 4, 2023 · 2 comments

Comments

@desolate-planet
Copy link

Hello,

I'm started to use this API to clear some SMB shares and I've tried the following API call:

for (FileIdBothDirectoryInformation f : share.list(targetFolder, "*.pdf"))

This works fine, but if I do the following: for (FileIdBothDirectoryInformation f : share.list(targetFolder, "*.pdf, *.xml")) , it doesn't work. I can't find any documentation on valid search patterns of even any examples. Can someone confirm what the correct pattern should be.

Also, is this the correct API call for files only, as I simply want to grab file details from a directory, check the age date and if the date has exceeded, I want to delete it. This API call is also providing directory info in it's results when it's purely files I'm after.

Thanks

@hierynomus
Copy link
Owner

Hi!

This is where you can find the reference to how this is implemented: MS-SMB2 2.2.33

  1. As you can see, all possible FileInformationClass options, talk about files and directories in a directory, so indeed, you will always get both
  2. The specifics for the wildcard are actually specified in MS-FSCC 2.2.1.1.3

@hierynomus
Copy link
Owner

Did this answer your question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants