Why are there both TMP and TEMP environment variables, and which one is right?
Key takeaways
- If you snoop around your environment variables, you may notice that there are two variables that propose to specify the location of temporary files.
- The operating system common on microcomputers was CP/M.
- (My recollection is that most CP/M programs were configured via patching.
If you snoop around your environment variables, you may notice that there are two variables that propose to specify the location of temporary files. There is one called TMP and another called TEMP. Why two? And if they disagree, then who s right?
Rewind to 1973. The operating system common on microcomputers was CP/M. The CP/M operating system had no environment variables. That sounds like a strange place to start a discussion of environment variables, but it s actually important. Since it had no environment variables, there was consequently neither a TMP nor a TEMP environment variable. If you wanted to configure a program to specify where to put its temporary files, you needed to do some sort of program-specific configuration, like patching a byte in the executable to indicate the drive letter where temporary files should be stored.
(My recollection is that most CP/M programs were configured via patching. At least that s how I configured them. I remember my WordStar manual coming with details about which bytes to patch to do what. There was also a few dozen bytes of patch space set aside for you to write your own subroutines, in case you needed to add custom support for your printer. I did this to add an Is printer ready to accept another character? function, which allowed for smoother background printing.)