JangJeewon / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

calling DeleteFile(some_directory) doesn't fail properly #172

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  run mirror.exe
2.  create a directory in the mounted drive
3.  remove it using DeleteFile  (I use python's os.remove function, which is a 
direct wrapper of DeleteFile)

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

I would expect the call to DeleteFile to fail, telling me that it doesn't work 
on directories.  Instead the call is forwarded to the DeleteDirectory callback 
and appears to succeed.

Looking at the debug output, when the Cleanup() call rolls around the removal 
fails with errcode -5, which is the expected behaviour.  But it's too late for 
this error to be reported back to the calling application.

So the DeleteFile call appears to succeed, but in fact silently fails.

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

Dokan 0.5.2 on Windows XP.

Please provide any additional information below.

I'm completely unfamilar with the Dokan code, but grepping around for calls to 
DeleteDirectory shows a promising starting point - the 
DokanSetDispositionInformation function calls either DeleteFile or 
DeleteDirectory based on the type of the file being operated on.  Seems to me 
that when the user app calls DeleteFile, this should call the DeleteFile 
callback regardless of the type of the file.

Original issue reported on code.google.com by rfkel...@gmail.com on 4 Aug 2010 at 11:14