Function 47h (71) Get Current Directory
Reports the full pathname of the current directory.
On entry: AH 47h
DL Drive number (0=default, 1=A, etc.)
DS:SI Pointer to a 64-byte buffer
Returns: AX Error code, if CF is set
Error codes: 15 Invalid drive specified
Call Function 59h for extended error code information
(DOS 3.0 and above).
--------------------------------------------------------------------------
This function returns the full pathname of the current directory,
excluding the drive designator and initial backslash character, as an
ASCIIZ string at the memory buffer pointed to by DS:SI.
Notes: The pathname may be as long as 63 bytes (without the
initial backslash), plus the terminating zero byte.
If the current directory is the root, the function
returns a null ASCIIZ string (that is, the first
byte of the buffer will be zero).
In some versions of DOS prior to 3.0, the pathname
can contain members that are longer than the 12-
character limit for file names. For example, this
function under DOS 2.0 returns
"directoryname\subdir" if the directory path
"\director\subdir" exists and the user typed
"cd \directoryname\subdir". Note that this path is
in lower case and contains too many characters. DOS
3.0 and above always return a correct path name in
upper case -- "DIRECTOR\SUBDIR" in this case.
Seealso:
This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster