
Click above to get retro games delivered to your door ever month!
X-Hacker.org- DOS 5.0 Ref. - <b>function 29h parse filename</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 29h Parse Filename
Converts a filename string on the form drive:filename.extension
into a string of the form required for a file control block (FCB).
This function is useful primarily when FCBs are used; it cannot be
used with file specifications which include a path (directory).
Entry AH = 29h
AL = Parse control mask
DS:SI = Pointer to a series of d:filename.ext strings
(? * allowed)
ES:DI = Pointer to an FCB structure
Return AL = 00h No wildcards found in filename.ext
01h One or more wildcards in filename.ext
0FFh Function failed (invalid drive letter)
DS:SI = Pointer to first un-parsed character
FCB structure modified, unless the parse control mask
specifies otherwise (ES and DI are unchanged)
If the string at DS:SI does not contain a
valid filename, FCB.fcbFileName (byte at
ES:DI+1) contains a space character
------------------------------------------------------------------
The parse control mask (in AL) controls how DOS parses the string
at DS:SI:
Bit Meaning
0 0 = Stops parsing if a filename separator is
encountered
1 = Ignores leading separators
1 If the string does not contain a drive letter
0 = sets FCB.fcbDriveID to 00h (default drive)
1 = leaves FCB.fcbDriveID unchanged
2 If the string does not contain a filename
0 = sets FCB.fcbFileName to 8 spaces
1 = leaves FCB.fcbFileName unchanged
3 If the string does not contain a file extension
0 = sets FCB.fcbExtent to 3 spaces
1 = leaves FCB.fcbExtent unchanged (a default
file extension, for example)
4-7 Reserved (0)
------------------------------------------------------------------
This function fills the fcbDriveID, fcbFileName, and fcbExtent
fields of the specified FCB structure unless the parse control
mask (passed in AL) specifies otherwise. To fill these fields, the
function strips any leading white-space characters (spaces and
tabs) from the string pointed to by DS:SI, then uses the remaining
characters to create the drive number, filename, and filename
extension. If bit 0 in the parse control mask is set, the function
also strips exactly one filename separator if one appears before
the first non-white-space character (SI advanced by 1). The
following are valid filename separators: :.;,=+
Once the function begins to convert a filename, it continues to
read characters from the string until it encounters a white-space
character, a filename separator, a control character (ASCII 00h
through 1Fh), or one of the following characters: /"[]<>|
------------------------------------------------------------------
If the filename in the string has fewer than 8 characters, the
function fills the remaining bytes in the fcbFileName field with
spaces. If the filename extension has fewer than 3 characters, the
function fills the remaining bytes in the fcbExtent field with
spaces.
If an "*" wildcard character is encountered in the filename or
extension, the function fills out the remaining bytes in the
fcbFileName or fcbFileExtent fields with "?" wildcard characters.
See Also: FCB
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson