delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/15/07:16:40

Message-ID: <35FECA07.EEBF2133@messa.ge>
Date: Tue, 15 Sep 1998 13:11:56 -0700
From: Student at Wageningen Agricultural University <look AT messa DOT ge>
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: MAX... constants
NNTP-Posting-Host: 137.224.14.61
Lines: 23
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello all,
As you might know fnsplit() splits a filename into the components drive,
dir, file and extension. It expects arguments (yes, I know the NULL
thingy) where these components can be stored. In the libc.a reference it
is stated that one can use the defined constants MAXDRIVE, MAXDIR,
MAXFILE and MAXEXT to allocate enough memory to store each component.
Under Windows 9x, that isn't true!

MAXDIR=66, MAXFILE=9 and MAXEXT=5. That might be proper values for plain
DOS, but not for Win 9x. Under Win 9x each of the components dir, file
and extension (if extension is defined as the part of a filename after
the first period) can be 259 characters long (259 is a value I read
somewhere. I did some quick tests but I didn't get names > 248 or
something. Does anyone know the real value?) The dir, file and extension
combined can't be larger than 259 characters also.

My question: Why have the MAX... constants such small values and not
just each a value of 259?

Daniel Horchner
email1dbjhorchner AT hotmail DOT com
email2Daniel DOT Horchner AT 95 DOT Student DOT WAU DOT NL

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019