Live data from Hacker News

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

devblogs.microsoft.com

21–30 of 102 posts

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

#21

> My recollection is that most CP/M programs were configured via patching. I honestly would have liked that better for a lot of programs than the dotfiles they litter all over my home directory.

Well, they are supposed to be all in .config, problem is many app developers think they are special little boys that deserve its own directory

%LOCALAPPDATA% on Windows. Or better still, use GetAppContainerFolderPath or SHGetKnownFolderPath with FOLDERID_LocalAppData.

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

#22
post #7

Earlier quoted context omitted.

Yes, it was definitely a thing. The patching code had to be in Z80/8080 machine code. I wrote higher performance keyboard and display routines for my copy of Wordstar using this feature.

Stuff like that is also cool (reminds me a bit of modding some games), patching machine code to improve performance of a compiled app? Very cool! (My dad might have done that, he has an old ZX81) But I thought specifically patching something to configure it is such a weird concept that I never would have thought of.

The line between "configuration" and "modding" is pretty thin.

One could say that the difference is whether the developers intended the changes you're making to be possible or not, but what about programs with dedicated modding APIs?

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

#23

> My recollection is that most CP/M programs were configured via patching. I honestly would have liked that better for a lot of programs than the dotfiles they litter all over my home directory.

If people just followed the XDG Base Directory Specification, config file littering would be a non-issue. More and more projects adopt it, even holdouts like Firefox.

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

#24

> My recollection is that most CP/M programs were configured via patching. I honestly would have liked that better for a lot of programs than the dotfiles they litter all over my home directory.

Well, they are supposed to be all in .config, problem is many app developers think they are special little boys that deserve its own directory

It all sounds so easy, until you learn about the XDG Base Directory Specification[1]. You're actually supposed to do a whole song and dance around a hierarchical set of environment variables, associated defaults, and resolution orders.

Interfacing with people is never easy.

[1]: https://specifications.freedesktop.org/basedir/latest/

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

#25

> My recollection is that most CP/M programs were configured via patching. I honestly would have liked that better for a lot of programs than the dotfiles they litter all over my home directory.

If people just followed the XDG Base Directory Specification, config file littering would be a non-issue. More and more projects adopt it, even holdouts like Firefox.

I contemplated for years and eventually saw someone implement a transparent kernel redirect for programs reaching for ~/.*

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

#26
post #12

Earlier quoted context omitted.

Yea this is something I'd love to see standardised, a distro that was able to enforce a .config folder somehow would be a winner for me. Think weve probably missed the boat though.

As these things go, there obviously is a standard for this called the XDG Base Directory Specification[0], which elegantly solves almost all configuration path needs—and has been ignored, violated, or only partially implemented, since forever. [0]: https://specifications.freedesktop.org/basedir/latest/

Say what you want about AI but one nice aspect of it is that it is more likely to follow these kinds of standards than humans.

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

#27

Earlier quoted context omitted.

Stuff like that is also cool (reminds me a bit of modding some games), patching machine code to improve performance of a compiled app? Very cool! (My dad might have done that, he has an old ZX81) But I thought specifically patching something to configure it is such a weird concept that I never would have thought of.

The line between "configuration" and "modding" is pretty thin. One could say that the difference is whether the developers intended the changes you're making to be possible or not, but what about programs with dedicated modding APIs?

At the time (early to mid 1980s) I think we would say "patching". The Wordstar devs certainly did mean you to do this - the memory locations available were fully documented, and I seem to remember they supplied a small patch utility to incorporate your code into the Wordstar executable.

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

#28
OK. I love Raymond’s blog but this is crazy. Microcomputers existed only as a prototype in 1973 (things like Intel’s Intellec dev systems) and there were no operating systems for them. Strictly speaking, Kildall did start developing CP/M in 1973, but at that point it ran only on a simulator on a PDP-10 mainframe.

1979, sure. 1973? Way too early…

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

#30
post #29
post #20

I'm confused by the CP/M reference. Author says it'll be important later then proceeds to explain how it had nothing to do with CP/M or the 8080 CPU.

could you quote the text you are referring to?

"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."
Post reply on HN