Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can not delete multiple files with ReadDirectoryChangesW

Can not delete multiple files with ReadDirectoryChangesW

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ShadowUz
    wrote on last edited by
    #1

    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.

    L D 2 Replies Last reply
    0
    • S ShadowUz

      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.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S ShadowUz

        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.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups