2

I update the hard disk root directory, information like long filename, filesize , filedate etc, using VC++ writefile function. However, I note window explorer do not know about this until it is re-booted such as a refresh or reopen another window explorer. I have tried call to SHChangeNotify and SendMessageTimeout but fail. My next step would be to try a fake of removal and insert of an external disk. Please help. thanks

2 Answers 2

3

Do not attempt to modify a filesystem directly while it is mounted (and if explorer can see it, it's mounted). The OS will maintain various cached representations of the filesystem, and modifying it behind the OS's back will result in inconsistencies between the cached representation and the actual FS, potentially corrupting the filesystem and any data in said FS.

Take a look at this serverfault question for some hints on how to perform an unmount.

-1

Try turning off the hard disk write cache, hopefully OS does not cache any file system data in RAM. This will affect IO performance but may help your experiment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.