Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!uunet.UU.NET!sef From: karish@mindcraft.com (Chuck Karish) Newsgroups: comp.std.unix Subject: Re: FILENAME_MAX & _POSIX_PATH_MAX relationship? Summary: Guarantees? Message-ID: <129356@uunet.UU.NET> Date: 13 Apr 91 07:13:30 GMT References: <128112@uunet.UU.NET> <128358@uunet.UU.NET> Sender: usenet@uunet.UU.NET Organization: Mindcraft, Inc. Lines: 24 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 Submitted-by: karish@mindcraft.com (Chuck Karish) In article <128358@uunet.UU.NET> decot@hpisod2.cup.hp.com (Dave Decot) writes: >[ X3J11 ] can footnote all they want; the text requires me to set FILENAME_MAX >to the size of the longest filename I *guarantee* can be opened. > >The length of that filename is 8, because I *guarantee* that the file >"/dev/tty" can be opened. Anything else, depends on what's on the system. I hadn't noticed that they prohibited the use of the O_CREAT flag in your call to open(). What's the fuss about? The C committee was trying to make it possible to write portable programs, not to constrain what must be present on your system. They were doomed to failure in an environment as complex as POSIX. That's why we have pathconf(). It's still reasonable to let the programmer know whether it's necessary to provide 13 characters or 256 or 1024 to hold a filename. Chuck Karish karish@mindcraft.com Mindcraft, Inc. (415) 323-9000 Volume-Number: Volume 23, Number 33