Re: path name limits

Bart Oldeman <[email protected]>
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
On Thu, 24 Oct 2002, Michael Honeyfield wrote:

>     What are tha path name limits imposed on freedos? MS-DOS has 66 and
> DR-DOS has 63, I need a few more :(.

79 for paths and 66 for directories is a fundamental DOS API limit,
because of (RBIL)

INT 21 - DOS 2+ - "CWD" - GET CURRENT DIRECTORY
        AH = 47h
        DL = drive number (00h = default, 01h = A:, etc)
        DS:SI -> 64-byte buffer for ASCIZ pathname
Return: CF clear if successful
            AX = 0100h (undocumented)
        CF set on error
            AX = error code (0Fh) (see #01680 at AH=59h/BX=0000h)
Notes:  the returned path does not include a drive or the initial
backslash many Microsoft products for Windows rely on AX being 0100h on
success under the FlashTek X-32 DOS extender, the buffer pointer is in
DS:ESI

So you can have 63 letters + ending 0 max for the directory.

This is also in

Format of current directory structure (CDS) (array, LASTDRIVE entries):
Offset  Size    Description     (Table 01643)
 00h 67 BYTEs   ASCIZ path in form X:\PATH (local) or UNC form
                  \\SERVER\PATH (network, see notes below)

 3 "D:\"
63 directory name
 1 '\0'
--
67

Then

66 directory name
 1 '\'
 8 filename
 1 '.'
 3 extension
 1 '\0'
--
80

is the buffer you need for full pathnames. Without using LFNs these are
fundamental DOS limits and there is nothing FreeDOS can do about it
without breaking DOS applications.

As far as I know there is no "number of nested directories" limit, as long
as you have less than 64 characters.

Fully qualified pathnames can be 128 characters but you would normally not
see them (maybe they can be the output of "truename" and/or used
*internally* by network redirectors, but nothing else as far as I know).

Bart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.