using the _findfirst() function

This is a discussion on using the _findfirst() function within the C++ Programming forums, part of the General Programming Boards category; Hi All, I'm trying to pass a directory name as the "char *filespec" for _findfirst(). But it doesn't seem to ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    18

    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???

    Thanks,
    Donal

  2. #2
    Registered User InFeStEd-ArCh0n's Avatar
    Join Date
    Apr 2002
    Posts
    63
    You have to specify some type of extension. If you want everything specify "*.*" So your string should say "C:\\*.*"
    -Mike
    {InFeStEd-ArCh0n}

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, 03:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 02:01 AM
  4. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 07:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21