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. multiple file scan filter

multiple file scan filter

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++question
4 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.
  • J Offline
    J Offline
    jspano
    wrote on last edited by
    #1

    Is there a way in c++ that I can do a file scan across a harddrive with multiple filters at once? Like search my HD for files that contain the filters *abc*|*def|rty| etc etc. I may have quite a few of them and don't want to keep scanning over and over for each one. I would prefer to do this in C#, but I'm fairly sure you can't. I can put a managed wrapper around some c++ if it will do this. TIA

    J D 2 Replies Last reply
    0
    • J jspano

      Is there a way in c++ that I can do a file scan across a harddrive with multiple filters at once? Like search my HD for files that contain the filters *abc*|*def|rty| etc etc. I may have quite a few of them and don't want to keep scanning over and over for each one. I would prefer to do this in C#, but I'm fairly sure you can't. I can put a managed wrapper around some c++ if it will do this. TIA

      J Offline
      J Offline
      Johan Rosengren
      wrote on last edited by
      #2

      Either you do the scan several times, or you look for all files, filtering it yourself - so, no can do.

      J 1 Reply Last reply
      0
      • J Johan Rosengren

        Either you do the scan several times, or you look for all files, filtering it yourself - so, no can do.

        J Offline
        J Offline
        jspano
        wrote on last edited by
        #3

        Oh well, thanks for the info. I'll get all and filter myself then. John

        1 Reply Last reply
        0
        • J jspano

          Is there a way in c++ that I can do a file scan across a harddrive with multiple filters at once? Like search my HD for files that contain the filters *abc*|*def|rty| etc etc. I may have quite a few of them and don't want to keep scanning over and over for each one. I would prefer to do this in C#, but I'm fairly sure you can't. I can put a managed wrapper around some c++ if it will do this. TIA

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

          You could parse the filter into its individual patterns, sending each one to a separate thread. Each thread would then report back to the primary thread with its findings. Or, for each file on the target drive, see if it matches any of the patterns in the filter. I did this once back about 11 years ago. It was a DOS-based utility and was a very good learning exercise.


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          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