Natasha15030003 / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

DeleteFile method will not be called in dokan when using in Win8 #159

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Mount a file system in Win8
2. Delete a file on the virtual drive 
3. The file will appear again after refreshing the Windows Explorer

What is the expected output? What do you see instead?

Expected: Delete the file
Instead: The file appears again after refreshing.

What version of the product are you using? On what operating system?

fs 0.4.1 (the current trunk), dokan 0.6.0, Windows 8

Please provide any additional information below.

Actually, this seems to be a dokan bug 
(https://code.google.com/p/dokan/issues/detail?id=269).
As stated by news.ivo@gmail.com, Win8 does not call DokanSetInformation at all.
Instead, Win8 set the FILE_DELETE_ON_CLOSE flag when calling CreateFile and 
close it immediately.

But since dokan has not been maintained for a long period of time, I suggest 
that pyFilesystem fixes this issue independently.
In the simplest implementation, 
One can check whether the FILE_DELETE_ON_CLOSE flag is set in CreateFile 
(fs.expose.dokan.__init__.py), and record these information in a set.
Then in the Cleanup function, add a corresponding or clause after the checking 
of info.contents.DeleteOnClose.
This method works fine for me.

Original issue reported on code.google.com by james0...@gmail.com on 21 Aug 2013 at 8:39