Function 4Eh (78) Find First Matching File (FIND FIRST)
Finds the first filename matching the specified filespec, and provides
information at the current Disk Transfer Address (DTA).
On entry: AH 4Eh
CX File attribute
DS:DX Pointer to filespec (ASCIIZ string)
Returns: AX Error code, if CF is set
Error codes: 2 File not found
3 Path not found
18 No more files to be found
Call Function 59h for extended error code information
(DOS 3.0 and above).
--------------------------------------------------------------------------
This function searches for the first filename matching the filespec
(ASCIIZ string pointed to by DS:DX). The filespec may include a drive
letter and path, and the filename can include wildcard characters.
The function returns information in a 43-byte area at the current DTA.
The information is formatted as follows:
Offset Size Description
00h 21 Used by DOS for find-next processing
(Function 4Fh)
15h 1 Attribute of file found
16h 2 Time stamp of file
18h 2 Date stamp of file
1Ah 4 File size in bytes
1Eh 13 Filename and extension, as an ASCIIZ string
The filename and extension are reported in conventional notation, with
blanks removed and a period between the filename and the extension. If
the file has no extension, the period is suppressed.
Notes: You can search for the next matching file using
function 4Fh (Find Next Matching File).
Function 1Ah can be used to set the DTA (Disk
Transfer Address).
You can control the scope of the search by entering
an attribute byte in CX. If CX is 0, the function
searches for normal files only. If CX specifies any
combination of the hidden, system, or directory
attribute bits, the search matches normal files and
also any files with those attributes. If CX
specifies the volume label attribute, the function
looks only for entries with the volume label
attribute. The archive and read-only attribute bits
have no effect on the search operation.
Seealso:
This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster