FILENAME_MAX & _POSIX_PATH_MAX relationship?

Chuck Karish karish at mindcraft.com
Sat Apr 13 17:13:30 AEST 1991


Submitted-by: karish at mindcraft.com (Chuck Karish)

In article <128358 at uunet.UU.NET> decot at 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 at mindcraft.com
	Mindcraft, Inc.		(415) 323-9000


Volume-Number: Volume 23, Number 33



More information about the Comp.std.unix mailing list