Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_dos_findfirst, _dos_findnext
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The _dos_findfirst routine uses system call INT 0x4E to return
information about the first instance of a file whose name and
attributes match the <filename> and <attributes> arguments.
Information is returned in a find_t structure, defined in DOS.H.
The filename argument may use wild cards (* and ?). The
<attributes> argument can be any of the following manifest
constants:
_A_ARCH _A_RDONLY _A_SYSTEM
_A_HIDDEN _A_SUBDIR _A_VOLID
_A_NORMAL
Multiple constants can be combined (with the OR operator) by using
the vertical-bar (|) character.
The _dos_findnext routine uses system call INT 0x4F to find the
next name, if any, that matches the <filename> and <attributes>
arguments specified in a prior call to _dos_findfirst. The
<fileinfo> argument must point to a structure initialized by a
previous call to _dos_findfirst. As described above, the contents
of the structure will be altered if a match is found.
If the <attributes> argument to either of these functions is
_A_HIDDEN, _A_RDONLY, _A_SUBDIR, or _A_SYSTEM, the function also
returns any normal attribute files that match the <filename>
argument. That is, a normal file does not have a read-only,
hidden, system, or directory attribute.
Do not alter the contents of the buffer between a call to
_dos_findfirst and a subsequent call to the _dos_findnext
function. Also, the buffer should not be altered between calls to
_dos_findnext.
The formats for the wr_time and wr_date elements are in DOS format
and are not usable by any other C run-time function.
See: ◄DOS Time/Date Format►
Return Value
If successful, both functions return 0. Otherwise, they return the
DOS error code and set errno to ENOENT, indicating that the
<filename> could not be matched.
-♦-