EldoS | Feel safer!

Software components for data protection, secure storage and transfer

CanFileBeDeleted problem on Windows 8

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 03/12/2015 08:05:24
by Bartosz Siewior (Priority Standard support level)
Joined: 01/13/2015
Posts: 6

I'm trying to implement security feature that would prevent from deleting some files that are currently in use by my application. For that I've implemented OnCanFileBeDeleted callback that sets CanBeDeleted to FALSE.

When Windows 7 explorer tries to remove file I don't get OnDeleteFile callback and explorers shows error that says the file cannot be deleted. On Windows 8 however the callback OnDeleteFile isn't called either but despite that explorer doesn't show any error and the file disappears from virtual drive.

Is that a bug in CBFS? How can I overcome the problem?
Also related question can I somehow specify custom message that would be displayed for user when file is forbidden to remove?

Posted: 03/12/2015 13:49:06
by Volodymyr Zinin (EldoS Corp.)

Hello Bartek,

There are two ways to delete file/directory in Windows. It is quite detailed described here: https://www.eldos.com/cbfs/articles/7966.php
Windows 7 uses the first variant, but Windows 8 the second one. That's why you see such behavior.



Topic viewed 1289 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!