Can not delete multiple files with ReadDirectoryChangesW
-
Hi everyone! I'm using ReadDirectoryChangesW for tracking any changes in the dedicated Source folder and apply it to the Destination folder. But, when multiple files are selected and deleted at once in the Source folder, only the first file is deleted in the Destination folder. Is there any way to delete all files at once? Thanks beforehand.
-
Hi everyone! I'm using ReadDirectoryChangesW for tracking any changes in the dedicated Source folder and apply it to the Destination folder. But, when multiple files are selected and deleted at once in the Source folder, only the first file is deleted in the Destination folder. Is there any way to delete all files at once? Thanks beforehand.
I haven't used this myself, however reading the MSDN documentation it seems ReadDirectoryChangesW fills a buffer with one or more FILE_NOTIFY_INFORMATION structures, of which the NextEntryOffset field is the key to finding the next (unless zero). From your description, it seems you are ignoring this field. [ADDED] The doc also says nothing gets returned when the buffer is too small, which is more likely to happen when lots of things need reported at the same time. You may want to ask for a bigger buffer. [/ADDED] :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
Hi everyone! I'm using ReadDirectoryChangesW for tracking any changes in the dedicated Source folder and apply it to the Destination folder. But, when multiple files are selected and deleted at once in the Source folder, only the first file is deleted in the Destination folder. Is there any way to delete all files at once? Thanks beforehand.
mints555 wrote:
But, when multiple files are selected and deleted at once in the Source folder, only the first file is deleted in the Destination folder.
If you are having trouble deleting files, what does that have to do with
ReadDirectoryChangesW()
? :confused: What does your deletion code look like?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius