I'm listening to changes within a folder using ReadDirectoryChangesW and one of the notifications I need to handle is FILE_ACTION_REMOVED. I need to know whether the deleted item was a file or a folder, but the notification doesn't give this type of information. I can't even seek it out myself because the item has been removed!

I'm hoping someone can give me the magic answer that tells me where to get this additional information. (Hum... maybe a ReadDirectoryChangesExW exists...) If not this is a serious flaw in the API that was imposed for no valid reason. A simple boolean wouldn't have added much to the memory and CPU demands of this operation and the lack of this information can do nothing but increase the bug risk.

The only thing that knows the state of that filesystem object at the time the notification was sent is the ReadDirectoryChangesW function itself. Even with notifications where I can gather this information for myself risks running into the situation where the item was deleted or renamed between the time where the notification was generated and handled. As much as Microsoft loves forcing us to add give its API all sorts of irrelevant information when making many calls you'd think they'd be kind enough to give us more information than they'd think we need instead of too little.



One thing I noticed about the ReadDirectoryChangesW is that it doesn't give enough information.