[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Int 21 Fn 4E - DOS 2+ - "findfirst" - Find First Matching File [D]
AH = 4Eh
AL = special flag for use by APPEND (see note below)
CX = file attribute mask (see AX=4301h) (bits 0 and 5 ignored)
0088h (Novell DOS 7) find first deleted file
DS:DX -> ASCIZ file specification (may include path and wildcards)
Return: CF clear if successful
[DTA] = FindFirst data block (see below)
CF set on error
AX = error code (02h,03h,12h) (see AH=59h)
Notes: for search attributes other than 08h, all files with at MOST the
specified combination of hidden, system, and directory attributes
will be returned. Under DOS 2.x, searching for attribute 08h
(volume label) will also return normal files, while under DOS 3+
only the volume label (if any) will be returned.
this call also returns successfully if given the name of a character
device without wildcards. DOS 2.x returns attribute 00h, size 0,
and the current date and time. DOS 3+ returns attribute 40h and the
current date and time.
immediately after an INT 2F/AX=B711h (APPEND return found name), the
name at DS:DX will be overwritten; if AL=00h on entry, the actual
found pathname will be stored, otherwise, the actual found path
will be prepended to the original filespec without a path.
under LANtastic, this call may be used to obtain a list of a server's
shared resources by searching for "\\SERVER\*.*"; a list of printer
resources may be obtained by searching for "\\SERVER\@*.*"
under the FlashTek X-32 DOS extender, the filespec pointer is in DS:EDX
BUGS: under DOS 3.x and 4.x, the second and subsequent calls to this function
with a character device name (no wildcards) and search attributes
which include the volume-label bit (08h) will fail unless there is
an intervening DOS call which implicitly or explicity performs a
directory search without the volume-label bit. Such implicit
searches are performed by CREATE (AH=3Ch), OPEN (AH=3Dh), UNLINK
(AH=41h), and RENAME (AH=56h)
DR-DOS 3.41 and 5.0 return the Directory attribute for the volume label
See Also: AH=11h,AH=4Fh,AX=4301h,INT 2F/AX=111Bh,INT 2F/AX=B711h
Format of FindFirst data block:
Offset Size Description
---PC-DOS 3.10, PC-DOS 4.01, MS-DOS 3.2/3.3/5.0---
00h BYTE drive letter (bits 0-6), remote if bit 7 set
01h 11 BYTEs search template
0Ch BYTE search attributes
---DOS 2.x (and some DOS 3.x???)---
00h BYTE search attributes
01h BYTE drive letter
02h 11 BYTEs search template
---WILDUNIX.COM---
00h 12 BYTEs 15-character wildcard search pattern and drive letter (packed)
0Ch BYTE search attributes
---DOS 2.x and most 3.x---
0Dh WORD entry count within directory
0Fh DWORD pointer to DTA???
13h WORD cluster number of start of parent directory
---PC-DOS 4.01, MS-DOS 3.2/3.3/5.0---
0Dh WORD entry count within directory
0Fh WORD cluster number of start of parent directory
11h 4 BYTEs reserved
---all versions, documented fields---
15h BYTE attribute of file found
16h WORD file time
bits 11-15: hour
bits 5-10: minute
bits 0-4: seconds/2
18h WORD file date
bits 9-15: year-1980
bits 5-8: month
bits 0-4: day
1Ah DWORD file size
1Eh 13 BYTEs ASCIZ filename+extension
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson