Closed robert-j closed 2 years ago
Thanks @robert-j for raising this documentation issues!
I have updated the doc in the library to remove the FindFiles part https://github.com/dokan-dev/dokany/commit/54ad5d71dfed4f885d985ad52c2029a0067fd3f7 but I believe the FindFilesWithPattern is correct, if it is null assigned, FindFiles will be called. https://github.com/dokan-dev/dokany/blob/master/dokan/directory.c#L695-L714
It must also mention that FindFiles must be implemented as well if FindFilesWithPattern is provided.
We can improve this π https://github.com/dokan-dev/dokany/commit/eb7b3ae4d6aeb4d02b7b2c3d0f852dad83793cf9
Does that look to be correct for you now ?
@Liryna, yes, the patch looks good. Thank you.
The FindFilesWithPattern docs are indeed correct.
I believe that we should add nevertheless a note to FindFilesWithPattern's docs stating that IF a file system is implementing FindFilesWithPattern then it SHOULD implement FindFiles as well.
That's true in the last release but with my last commit you can just implement FindFilesWithPattern and it will be called with a wildcard.
Yes, I saw this. I was just nitpicking. SHOULD was meant as in "implement it when you can". It would save a lot of DokanIsNameInExpression calls, for example.
Good point π https://github.com/dokan-dev/dokany/commit/3cbd08ea8c08c1053d62d0e43a0011fe017e8f22 Note: The library code path used behind is the same whether FindFiles or FindFilesWithPattern was used during a non-pattern listing https://github.com/dokan-dev/dokany/blob/master/dokan/directory.c#L404
Thanks again for your report π
Environment
Check List
Description
The documentation of Dokany 2.0.3 FindFiles states that
The documentation of Dokany 2.0.3 FindFilesWithPattern states that
This is not true in Dokany 2 any more. I've finished porting a project from 1.4 to 2.0.3 in which FindFiles* were implemented as follows:
This code is causing all FindFirst operations to fail because Dokany is never invoking MyDriverFindFilesWithPattern. It is only invoking MyDriverFindFiles, and doesn't pay attention to STATUS_NOT_IMPLEMENTED.
I also tried to set DOKAN_OPERATIONS.FindFiles = NULL to no avail.
The document Update Dokan 1.1.0 application to Dokany 2.0.0 is also misleading as it states:
It must also mention that FindFiles must be implemented as well if FindFilesWithPattern is provided.