Xref: utzoo comp.sys.ibm.pc:16870 comp.lang.c:11057 Path: utzoo!attcan!uunet!husc6!bloom-beacon!think!ames!amdahl!pyramid!nsc!voder!kontron!optilink!cramer From: cramer@optilink.UUCP (Clayton Cramer) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: MSC V5.x, tempnam function gotcha Message-ID: <250@optilink.UUCP> Date: 1 Jul 88 00:21:36 GMT Organization: Optilink Corporation, Petaluma, CA Lines: 19 I ran into an interesting quirk (I hesitate to call it a bug) of the tempnam function in Microsoft C. The tempnam function provides a fairly painless way to create temporary file names in the directory specified by your TMP environment variable. However, there is a slight quirk. The manual says that the temporary file name is created in "Directory specified by TMP" if "TMP environment variable is set, and directory specified by TMP exist." So, when I tried to use it, it behaved as though TMP wasn't set, or the directory specified didn't exist. The cause, it turns out, was that my AUTOEXEC.BAT file says, "set TMP=e:" and tempnam doesn't consider "e:" by itself to be a directory -- it needs "e:\". As I said, it's not really a bug -- it does EXACTLY what it says it will do, but it's only obvious to the very literal-minded (or a computer) that "e:" is not a directory in this context. Clayton E. Cramer