Thread: File Searching with _findfirst and _findnext

  1. #1
    l WolfPac l
    Guest

    File Searching with _findfirst and _findnext

    I have looked at other posts based on this topic but my question was not answered. I am searching for a file that is specified by the command-line. I have the DevC++ compiler and I have roughly all the logic good to go but I still have one question. I noticed that with some of the other questions regarding this topin involved the ffblk structure while in DevC++ there is no ffblk struct as dir.h is considered obsolete by their standards and created the io.h header file instead. The two functions, _findfirst and _findnext are different as _findfirst returns a handle that will be used by _findnext. My problem is that I do not know how to get the two to work off of each other.

    /*
    * Functions for searching for files. _findfirst returns -1 if no match
    * is found. Otherwise it returns a handle to be used in _findnext and
    * _findclose calls. _findnext also returns -1 if no match could be found,
    * and 0 if a match was found. Call _findclose when you are finished.
    */
    int _findfirst (const char* szFilespec, struct _finddata_t* find);
    int _findnext (int nHandle, struct _finddata_t* find);
    int _findclose (int nHandle);

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    29
    Nevermind. I figured it out.

Popular pages Recent additions subscribe to a feed