What exactly is a scratch file (starting with #)? Does it still work today?
18
votes
2
answers
2002
views
I've been reading up on some Unix history and got interested into the
csh
because it's installed by default on OpenBSD.
In the csh
manpage it had a reference to "W Joy - An Introduction to the C shell", which I could get a hold of. Therein, in Chapter 1.3 it explains simple file redirection and makes an example, quite perplexing to me:
> The system normally keeps files which you create with ‘>’ and all other files. Thus the default is for
files to be permanent. If you wish to create a file which will be removed automatically, you can begin its
name with a ‘#’ character, this ‘scratch’ character denotes the fact that the file will be a scratch file.* The
system will remove such files after a couple of days, or sooner if file space becomes very tight. Thus, in
running the date command above, we don’t really want to save the output forever, so we would more likely
do
>
> date > #now
Now I never heard of a scratch file. Is this a long forgotten thing? Does it still work today? Is it just disabled? When will it get deleted (couple days?)? by what (cron?)?
I've run the command on an OpenBSD and on a Linux System (date > '#now'
because its a comment in /bin/sh
), but I can't wait (or might just answer myself in a "couple days").
Does anybody know more about this, preferably some more history. I couldn't find anything from few a quick searches.
Thanks in advance!
Asked by MarcDefiant
(291 rep)
Sep 23, 2024, 10:26 PM
Last activity: Sep 25, 2024, 07:14 AM
Last activity: Sep 25, 2024, 07:14 AM