-
Notifications
You must be signed in to change notification settings - Fork 671
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
Call for better Mirror example for application to manage file context #1043
Comments
Hi @kice , This case is documented here https://dokan-dev.github.io/dokany-doc/html/ and handled by samples. Maybe we could document it directly in the callback documentation. Would you be willing to open a pull request for this ? Fyi there is another issue open for this case #1016 |
Btw, I just noticed that it will close the handle after re-open the file object. Why not keep the new handle back to context? dokany/samples/dokan_mirror/mirror.c Lines 615 to 618 in cea3ea6
After a file object was successfully created, will dokan call back I would like to see store a struct in mirror |
Exact The mirror sample is only storing the Doc was improved 6bbbbc7 |
So far I what understand for mirror if using
For mem mapped file, we should always return the last-written-to-disk data to read operation, and any write operation must be committed to actual file; for read and write, more or less like we have transferred the internal file object to the kernel as soon as use request to map the file object.
Some other thought as well, if And may I suggest that it is a good idea that check |
This looks to be exact and follow the documentation. Let me know if you find any issue in the project and I will be glad to look into it. |
Looks like all operations have requests
FileName
as parameter. However it suggests that we could store application specific information toDOKAN_FILE_INFO.Context
.I checked some issues and looked at the PDOKAN_OPERATIONS Struct Reference, but it looks like it does not say we have to reopen for
ReadFile
andWriteFile
. Only thing I found useful regarding this was here:https://github.com/dokan-dev/dokan-dotnet/blob/f30f724babf864863700293b2bcb2edef06bc365/sample/DokanNetMirror/Mirror.cs#L282
So only
ReadFile/WriteFile
were affected, other operations will be fine for memory mapped file operations? If so, please add this kind of information to the documentation.Why not add an optionalflush
callback?The text was updated successfully, but these errors were encountered: