FindFirstFile


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: FindFirstFile

  1. #1
    Dean Earley Guest

    FindFirstFile

    What is the best way to do a search (using FindFirstFile and friends) for multiple extensions?

    e.g. "*.htm; *.html"
    Ive tried that and prepending each criteria with a path. At the moment, I'm doing 2 seperate searches, but its not that flexible.

    I dont want to use FindFirstFileEx, because it is NT4+ only

    Thanks

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems



  2. #2
    Dean Earley Guest

    Re: FindFirstFile

    > Can you use "*.htm*" for your search? Depending on how many files you expect
    > to find, 2 searches may be the best way. You could also do a broader search
    > and then send the resulting list through some code with the selection criteria
    > in it.


    Sorry, I used that as an example, the files are *.email, *.page, and *.sms and worst case it will be searching through several
    thousand files. I do it in 2 places, the first use FindFirstFile and I repeat it several times, the other uses Dir (yes, I know its
    evil ), and I search the whole lot and handle what I want.

    Thanks

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems



  3. #3
    Dean Earley Guest

    Re: FindFirstFile

    "Dean Earley" <dean.earley@icode.co.uk> wrote in message news:3cd27bb4@10.1.10.29...
    > > Can you use "*.htm*" for your search? Depending on how many files you expect
    > > to find, 2 searches may be the best way. You could also do a broader search
    > > and then send the resulting list through some code with the selection criteria
    > > in it.

    >
    > Sorry, I used that as an example, the files are *.email, *.page, and *.sms and worst case it will be searching through several
    > thousand files. I do it in 2 places, the first use FindFirstFile and I repeat it several times, the other uses Dir (yes, I know

    its
    > evil ), and I search the whole lot and handle what I want.


    Oops, Ive just noticed the thread that OE tagged this onto.

    >I wish to recursively search a directory (and its subdirectories) for graphic
    >files (JPG, GIF, BMP, etc.). Is it possible to specify more than one file
    >specification for the lpFileName parameters?


    Jim,

    No, I think you have to search for *.* , and then filter out the ones
    you don't want by checking the extension of the filename returned in
    the WIN32_FIND_DATA structure.

    Thanks anyway (

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems



  4. #4
    Craig Brown Guest

    Re: FindFirstFile


    Dean,

    Can you use "*.htm*" for your search? Depending on how many files you expect
    to find, 2 searches may be the best way. You could also do a broader search
    and then send the resulting list through some code with the selection criteria
    in it.

    Craig Brown


    "Dean Earley" <dean.earley@icode.co.uk> wrote:
    >What is the best way to do a search (using FindFirstFile and friends) for

    multiple extensions?
    >
    >e.g. "*.htm; *.html"
    >Ive tried that and prepending each criteria with a path. At the moment,

    I'm doing 2
    >seperate searches, but its not that flexible.
    >
    >I dont want to use FindFirstFileEx, because it is NT4+ only
    >
    >Thanks
    >
    >--
    >Dean Earley (dean.earley@icode.co.uk)
    >Assistant Developer
    >
    >iCode Systems
    >
    >



  5. #5
    Grinder Guest

    Re: FindFirstFile

    Just a little extra info -- didn't see it mentioned. The "Like" operator
    works much like filename matching, and can be of some use.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center