Contents of argv[0]

Tom Neff tneff at bfmny0.UUCP
Tue Aug 22 00:45:43 AEST 1989


As far as the C language itself goes, this discussion is completely
meaningless.  It's ludicrously parochial to insist that argv[0] hold a
"PATHNAME," whatever in the world that may be.  In the universe of
possible C implementations, you don't even necessarily associate one
program with one "FILE," or even have such a thing as "FILE."  All that
argv[0] gives you is a "handle" by which you can refer to the program.
For error messages and such, that's all you need.  Attempting to be
precious by "extracting" the "name" portion only for use in error
messages is a non portable operation.

To the extent that UNIX-oid type people have a legitimate interest in
being able to parse argv[0] pathwise, the issue should be addressed by
POSIX and discussed in comp.sys.whatever.
-- 
"We walked on the moon --	((	Tom Neff
	you be polite"		 )) 	tneff at bfmny0.UU.NET



More information about the Comp.lang.c mailing list