Thread: Searching for Directories?

  1. #1
    Registered User
    Join Date
    Jul 2003

    Question Searching for Directories?

    I know how to search for files using findfirst() and findnext(). But that only works for files. How can I search for Directories using C++? I would be grateful to anybody who can help me out on this one.

  2. #2
    Registered User
    Join Date
    Oct 2002
    Check out this page .

    You need to use FindFirstFile() and FindNextFile() and you can figure out if it's a directory like this :
    if( win32FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) //not extension
      // directory
    Last edited by laasunde; 07-29-2003 at 10:04 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 05:20 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Visual C++ 2005 linking and file sizes
    By Rune Hunter in forum C++ Programming
    Replies: 2
    Last Post: 11-12-2005, 10:41 PM
  4. Searching and matching strings: segmentation fault
    By Smola in forum C Programming
    Replies: 18
    Last Post: 07-11-2005, 12:25 AM