Thread: file search app

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    29

    Angry file search app

    HI there,

    I a have written a console application that mimics the windows file / folder search application that comes with all windows installations. I am using a recursive function that searches all files and folders in the tree structure and I am using the readdir() function at each level. Some code below:-

    pDir = opendir(pFolderPath);

    // search for files
    while ( (pEntry = readdir(pDir)) != NULL )
    {

    // more code here
    }

    pFolderPath must be a valid folder path like c:\temp\fred, etc

    Question. How can I search the root directory ? ie How can I pass simply "c:\" to my routine ? Clearly opendir(c:\) will return NULL


    THanks all,

    bigSteve
    bigSteve

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    I think in the FAQ, there is an example, search it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  2. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM