Live data from Hacker News

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

devblogs.microsoft.com

81–90 of 102 posts

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

#81

Earlier quoted context omitted.

In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

> In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up. /tmp must be world-writable and for multi-user or multi-tenant systems it becomes a security hole. Storing temporary files in the current user's home directory (or a subdirectory thereof) makes sense. What doesn't make sense is this blog post…

> /tmp must be world-writable and for multi-user or multi-tenant systems it becomes a security hole. Storing temporary files in the current user's home directory (or a subdirectory thereof) makes sense.

It makes sense when it's a user option. If /tmp isn't an option due to security concerns, then use $CWD by default. I can always alter the config to some other location if I do not like it. With the amount of programs that litter $HOME, especially with caches, you have to whitelist directories when backing it up. With a naive rsync, you'll find half your transfer is junk.

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

#83

> 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.

I'll take dotfiles I can grep and mange with a text editor over settings littered all over a central binary registry. But maybe that's just what I'm used to.

I'm the opposite: I'll take a centralized, strongly-typed registry over 'stringly' typed dotfiles scattered across the entire filesystem.

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

#84
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.

If CP/M had used environment variables for configuration, presumably there would have been an established standard for TMP vs. TEMP that DOS would have adopted. The real catch, however, is that CP/M didn’t have directories. Nor did DOS 1.0.

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

#85

> These surface vibrations are so minute that they are not critical from a mechanical point of view (unlike e.g. vibrations due to imbalance), but they can cause serious acoustic problems. The reason for this is that when the fan is running, there is a pressure difference between the intake and the outlet side of the fan (lower pressure on the upside of the blades, higher pressure on the downside of the blades). From…

You appear to have commented on the wrong post.

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

#86
post #80
post #27

Earlier quoted context omitted.

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.

I remember the words "peeking" and "poking", but this may have been specific to basic.

Yes, most Basics had peek and poke commands with which you could read and write specific memory locations. For example - parentheses may or may net be needed, depending on the Basic implementation:

    X = PEEK( 123 )
would read the byte at memory location 123 and store its value in X. Then

   POKE( 123, 42 )
would change the byte at 123 to be 42.

But these didn't normally have so much to do with patching executables to add/change functionality.

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

#87
post #80
post #27

Earlier quoted context omitted.

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.

I remember the words "peeking" and "poking", but this may have been specific to basic.

I remember looking into BASIC sources to figure out how they did some things I had no idea how to do with BASIC... and finding POKE statements with weird numbers, it was looking a bit like magic... (I was probably 10 or so, though)

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

#88
post #2

1995-ish. Telstra (Australia Telecom). Probably about 50k desktop computers across the organisation. One day a small file turned up in everyone's network home directory called null. A *nix person had evidently had a go at writing a .bat file. Why do we need to adopt extant standards? (I was going to ask, why standardise? But realised that might confound the North Americans. : )

Some Logitech drivers installation program (not sure which version or what product) did it too... found a file named NULL on my HD, and of course there was a BAT file with something > NULL.

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

#89

> 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.

I'll take dotfiles I can grep and mange with a text editor over settings littered all over a central binary registry. But maybe that's just what I'm used to.

Every single program has to write logic to parse/store/query/validate those values. A common API with a single store can be type-enforced, backed up, and likely easier to work with from an internationalization perspective.

I do like dotfiles for portable apps where everything the program needs is in one folder. Personally, my need for portable apps has gone down year on year.

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

#90
One of the first things I do (after using O&O ShutUp10++ of course) when setting a new installation is to create "C:\Temp\" folder and go to them variables to point there. Mind you, you have global TMP and TEMP, and you have user defined (which points to \Windows\Temp instead of %LOCALAPPDATA%/Temp) ones. All 4 will point to my folder and makes my life a lot easier in the long run
Post reply on HN