When is ReadFile() called? #1222
Replies: 2 comments
-
It is expected that the system or apps do random read to try to find what it contains or just to generate a thumbnail / preview. If you want to know whether you should download the file, you will need to analyze the pattern see if sequential reads are happening and therefore has a good chance to end up reading the whole. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. I understood why ReadFile() is so many called. |
Beta Was this translation helpful? Give feedback.
-
I want to download a file when I open it(when I double click to run it or when I open a document, etc).
So I am implementing something in DOKAN_OPERATIONS ReadFile() api callback.
I am going to download a file when ReadFile() is called. But it seems that ReadFile() is also called in many other cases.
When I move mouse over some files(ex: test.exe file), ReadFile() of test.exe is called.
When I open a folder which test.exe is in, ReadFile() of test.exe is called.
When I double click test.exe, ReadFile() of test.exe is called.
When I click mouse right button on test.exe, ReadFile() of test.exe is called.
Is there a way to know that I really open a file to run exe file or read a document file in ReadFile()?
If I am trying in wrong way, then how to download a file when we need(open) it?
Environment:
Dokan Version: 2.1.0
Operating System: Win10 & Win11
Beta Was this translation helpful? Give feedback.
All reactions