Thread: Finding files in a folder

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    36

    Finding files in a folder

    How do you supply a wildcard to something and then it returns a list of all files that match it? For example, I want to parse all *.txt files in a directory, how would I go about doing that? In other languages it's been FindFirst and FindNext

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    The method of doing this is operating system dependent: the C and C++ standards do not define this sort of functionality.

    If you're under windows, the functions in the win32 SDK are FindFirstFile() and FindNextFile(), which are declared in the (windows specific) header <winbase.h>. On other operating systems, the function names are different.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    <fake excitement>
    I know this, I know this!!!!!
    <bored again>
    http://faq.cprogramming.com/cgi-bin/...&id=1044780608
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Making a folder and moving files into it?
    By HLA91 in forum C Programming
    Replies: 1
    Last Post: 01-27-2008, 12:38 PM
  2. Finding files in a directory
    By smarta_982002 in forum C Programming
    Replies: 1
    Last Post: 01-25-2008, 10:10 AM
  3. How To Make The Program Installed In Program Files Folder?
    By javacvb in forum Windows Programming
    Replies: 4
    Last Post: 11-05-2003, 05:33 PM
  4. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  5. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 09:35 AM