Thread: File searching

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    147

    File searching

    I would like to search a file or files whose names begin with a specified set of characters...

    is that possible? something like a wild character...
    Only by the cross are you saved...

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490

    Re: File searching

    Originally posted by fkheng
    I would like to search a file or files whose names begin with a specified set of characters...

    is that possible? something like a wild character...
    Get the list of filenames. (That depends on your operating system.) Then use strncmp to compare what you have to what you're looking for.

    That's not the most flexible way, but it does what you're asking without much work.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    147
    wat i mean is can i search and obtain filenames which begin with a specified set of characters?
    Only by the cross are you saved...

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    just use the code in the faq and run strstr

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  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