Thread: using the _findfirst() function

  1. #1
    Registered User
    Join Date
    Mar 2002

    using the _findfirst() function

    Hi All,
    I'm trying to pass a directory name as the "char *filespec" for _findfirst(). But it doesn't seem to work. How would I specify a directory name to this function??

    directoryname holds: "c:\\"
    _findfirst( directoryname, &c_file ))
    It says that there aren't any files in this directory??

    Any ideas??? Maybe there is a different function that you would suggest using???


  2. #2
    You have to specify some type of extension. If you want everything specify "*.*" So your string should say "C:\\*.*"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 06:44 PM