MSC V5.x, tempnam function gotcha

Tom Neff tneff at dasys1.UUCP
Wed Jul 6 06:19:52 AEST 1988


Clayton Cramer points out that the MSC5.x 'tempnam' function doesn't
recognize an environment variable of the form 'TMP=e:' -- it requires
the trailing backslash, as in 'TMP=e:\'.

Perhaps the MSC RTL people were being a tad literal-minded here, but I
ought to point out that in DOS parlance, "e:" is NOT a unique and
invariable directory specification -- in particular it does NOT mean
the root directory of the disk in the E drive.  What it means is the
*current* directory selected on the disk in the E drive.  This can
change with every CHDIR command and chdir() call.  MS-DOS retains a
separate "current directory" for every disk drive attached.  If a path
specification does not include a leading backslash (after any drive
identifier), DOS will attempt to base the path from the current
directory on the specified (or default) drive.  

The MSC folks probably decided that only an invariant, absolute path
spec was suitable for what they wanted to do with the TMP variable.
Reasonable people might disagree on this, but I don't think they are
completely in left field.
-- 
Tom Neff			UUCP: ...!cmcl2!phri!dasys1!tneff
	"None of your toys	CIS: 76556,2536	       MCI: TNEFF
	 will function..."	GEnie: TOMNEFF	       BIX: t.neff (no kidding)



More information about the Comp.lang.c mailing list