On Tue, 3 Jan 2006, Andre Tertling wrote:

Blair Campbell wrote:
obvious question. What is the maximum path and/or filename length under

I think that it's 2 + 80 + 8 + 3, but I could be wrong.

This may be true, but command lines are IIRC limited to 80 chars. It may be possible to extend that to the 93 chars you mentioned by using environment variables, but I'm not sure about that. (...and I don't feel like trying, might break other things...)

In DOS command lines are restricted to 126 bytes for the options.
(the PSP has room for 128 characters, of which one is a length byte and one an end byte (0Dh))
Windows 95 and 4DOS extend this using the environment.

Paths are 79 bytes max. The limiting factor comes from the get directory function, which is passed a 64 byte buffer for the directory name excluding c:\ but including an ending 0. So we get

C:\               3
directory name   63
\                 1
filename          8
.                 1
ext               3
                 __ +

a terminating 0 gives the infamous limit of 80.


This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
Freedos-user mailing list

Reply via email to