Hasty Briefsbeta

Bilingual

Why are there both TMP and TEMP environment variables? (2015)

5 hours ago
  • #History of Computing
  • #Environment Variables
  • #Operating Systems
  • The TMP and TEMP environment variables originated from MS-DOS's adoption of environment variables, with no prior usage in CP/M systems where configuration was done via executable patching.
  • MS-DOS 2.0 introduced piping using temporary files and adopted TEMP for this purpose, but programs varied in preferring TMP or TEMP based on author choice, leading to ongoing inconsistency.
  • Windows programs often use GetTempFileName, which checks TMP first, while older MS-DOS utilities like DISKCOPY checked TEMP first, highlighting the historical and program-dependent nature of these variables.