←back to thread

Against /tmp

(dotat.at)
257 points todsacerdoti | 2 comments | | HN request time: 0.429s | source
Show context
pjmlp ◴[] No.41914057[source]
So here we have again how "Worse is better" works in practice, and how we got here regarding /tmp in 2024.
replies(1): >>41914337 #
anthk ◴[] No.41914337[source]
As if C:\TEMP or %tmpdir% were any better.

Or using letters as drivers.

Worse is better? A lot of tech in Win32 is built as if it were for DOS 1.0 or CP/M. See AUX, PRN, COM and so.

replies(3): >>41914828 #>>41915035 #>>41915497 #
tredre3 ◴[] No.41915035[source]
> As if C:\TEMP or %tmpdir% were any better.

I mean, yes? %tmp% is in the user's directory, not accessible by the world.

replies(1): >>41916486 #
anthk ◴[] No.41916486[source]
TMPDIR can be trivially set at $HOME/tmp too with just a file at /etc/profile
replies(1): >>41920774 #
1. int_19h ◴[] No.41920774[source]
But how many things on Unix hardcode /tmp though?

On DOS it wasn't a thing because it didn't have a standard temp directory to begin with, so when the need arose, it was bolted on in an adhoc way (I remember the apps couldn't even agree on whether it should be %TEMP% or %TMP% or something else). Windows introduced it as a proper first party concept, but then moved it around so much that you pretty much had to use the API to retrieve the actual value if you wanted it to work. And then NT made that API return a path to a per-user directory by default.

replies(1): >>41922553 #
2. anthk ◴[] No.41922553[source]
Most things in Unix are libre software. Recompiling them to use another path it woudn't be rocket science.