programming - C - functions for searching for filesWhat links here?
defined in io.h:

/*
 * 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);


usage:

struct _finddata_t c_file;
long hFile;


if ( (hFile = _findfirst("*.c", &c_file)) == -1L ) { printf("No *.c files in current directory"); } else { do { printf("%s\n", c_file.name); } while ( _findnext(hFile, &c_file) == 0 ); _findclose(hFile); }


the _finddata_t struct:

/*
 * The following structure is filled in by _findfirst or _findnext when
 * they succeed in finding a match.
 */
struct _finddata_t
{
        unsigned    attrib;             /* Attributes, see constants above. */
        time_t      time_create;
        time_t      time_access;        /* always midnight local time */
        time_t      time_write;
        _fsize_t    size;
        char       name[FILENAME_MAX];  /* may include spaces. */
};
programming - C - functions for searching for files
microprocessors - microchip pic - labx 20 - pushbuttons
MC6802 - instruction set - Load Index Register
embedded systems - uds100 - configuration
AutoCAD LISP - CAADR
Model Railroading - tie dimensions
MC6802 - instruction set - Store Index Register
Raspberry PI - restart or shutdown
AutoCAD LISP - ENTMAKE
AutoCAD LISP - TBLOBJNAME
This:is:tests
file formats - PDF - xref table
AutoCAD LISP - ENTNEXT
filename:programming - C - functions for searching for files
filename:programming%20%2D%20C%20%2D%20functions%20for%20searching%20for%20files
last edit:January 07 2010 20:24:56 (5972 days ago)
ct = 1778923189.000000 = May 16 2026 05:19:49
ft = 1262913896.000000 = January 07 2010 20:24:56
dt = 516009293.000000