Article View: comp.std.unix
Article #800Re: FILENAME_MAX & _POSIX_PATH_MAX relationship?
From: David A Willcox
Date: Mon, 08 Apr 1991 14:18
Date: Mon, 08 Apr 1991 14:18
34 lines
2057 bytes
2057 bytes
Submitted-by: willcox@urbana.mcd.mot.com (David A Willcox)
>Would someone who knows please tell me the relationship between the
>Standard C macro FILENAME_MAX and the POSIX macro _POSIX_PATH_MAX.
Since FILENAME_MAX is the longest possible filename string that can be
passed to fopen() and the like, it should be a value no smaller than
the largest possible value for PATH_MAX on your system. It mustn't
ever be smaller than _POSIX_PATH_MAX, and would only be that small on
an implementation that only supported the minimum value for PATH_MAX
required by POSIX.
To quote from the C standard, FILENAME_MAX:
... expands to an integral constant expression that is the size needed
for an array of char large enough to hold the longest file name
string that the implementation guarantees can be opened. [There's
a footnote saying that this doesn't mean that just any string this
long is a valid file name.]
Since the C standard does not have any concept of directories, "file
name" in this context clearly corresponds to a POSIX path, not an
individual file name.
(Standard disclaimer stuff. Motorola and POSIX disavow all knowledge of
my actions.)
David A. Willcox "Just say 'NO' to universal drug testing"
Motorola MCD - Urbana UUCP: ...!uiucuxc!udc!willcox
1101 E. University Ave. INET: willcox@urbana.mcd.mot.com
Urbana, IL 61801 FONE: 217-384-8534
Volume-Number: Volume 23, Number 25
Technical Details
Message-ID:
<128112@uunet.UU.NET>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!uunet.UU.NET!sefReferences:
<127638@uunet.UU.NET>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!uunet.UU.NET!sef From: willcox@urbana.mcd.mot.com (David A Willcox) Newsgroups: comp.std.unix Subject: Re: FILENAME_MAX & _POSIX_PATH_MAX relationship? Message-ID: <128112@uunet.UU.NET> Date: 8 Apr 91 14:18:15 GMT References: <127638@uunet.UU.NET> Sender: usenet@uunet.UU.NET Organization: Motorola Computer Group, Urbana Design Center Lines: 34 Approved: sef@uunet.uu.net (Moderator, Sean Eric Fagan - comp.std.unix) Nntp-Posting-Host: uunet.uu.net X-Submissions: std-unix@uunet.uu.net Originator: sef@uunet.UU.NET