Thread: Searching for a file using FindFirstFile() ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212

    Searching for a file using FindFirstFile() ?

    I know salem has discussed this before, but I am using LCC-Win32 at the moment and need to find out how to search the entire hard drive for sol.exe (solitare).

    Here's a snippit of code that works with my compiler:
    Code:
    int findSolitaire(void)
    {
     WIN32_FIND_DATA solitaire;
     FindFirstFile("sol.exe",&solitaire);
     MessageBox(NULL,solitaire.cFileName,solitaire.cFileName,0);
     return 0;
    }
    This only works if solitaire is in THE SAME DIRECTORY as the running program. Please post an example of one that searches the entire hard drive.

    PS: chdir() doesn't work in my compiler (LCC is C-Only, so C++ functions don't work)
    Last edited by Brian; 01-27-2002 at 12:46 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  4. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM