[net.unix-wizards] /tmp vs. /usr/tmp

kendall@wjh12.UUCP (Sam Kendall) (10/15/84)

> No utility should use /tmp for large files.  That is what /usr/tmp is for.

(I think this is only supposed to be the case for USG UNIX.  Do non-USG
utilities use /usr/tmp much or at all?)  But I have seen a System V
system with a small /usr/tmp and a very large /tmp; conversely, I have
seen a 3B2 which came configured with a small /tmp and large /usr/tmp--but
the system utilities (compiler, assembler) on the 3B2 used /tmp by default,
leading to overflows!

   There is an undocumented (?) way around this--the TMPDIR environment
variable, which many utilities on System V use to determine their choice
of /tmp directory, if TMPDIR is available.  It would be nice if there
was a standard program which would look at the output of df and output
the proper TMPDIR value, perhaps based on a given amount of disk space
required--shell scripts or .profile's could use it.  I have a use for
such things, and I think anyone else who uses a lot of tmp space (e.g.,
anyone who uses the wonderful but space-greedy System V C cross-
referencer "cxref") would also.  Does anyone think this is a good idea?
Any volunteers to write it?  I'm not on a System V system.

	Sam Kendall	  {allegra,ihnp4,ima,amd}!wjh12!kendall
	Delft Consulting Corp.	    decvax!genrad!wjh12!kendall

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (10/16/84)

TMPDIR is documented but many utilities and user applications do
not use the new tempnam() function but rather the old mktemp().
With Release 2 of UNIX System V, the C compiler has been changed
to use /usr/tmp by default.  The main utility that concerns me is
"sort", which can really eat up temp space.

mab@druxp.UUCP (BlandMA) (10/18/84)

>   The main utility that concerns me is
>   "sort", which can really eat up temp space.

There is an undocumented flag in the System V sort(1) that allows you
to specify the directory where it creates its temp files.
Try "sort -T /new/temp/dir ...".  I don't know if it exists in
other versions of UN*X, and I don't know why it's not documented.

-Alan Bland, ihnp4!druxp!mab, AT&T-ISL Denver

henry@utzoo.UUCP (Henry Spencer) (10/22/84)

> There is an undocumented flag in the System V sort(1) that allows you
> to specify the directory where it creates its temp files.
> Try "sort -T /new/temp/dir ...".  I don't know if it exists in
> other versions of UN*X, and I don't know why it's not documented.

You're sure it's not documented?  It *is* documented in V7!  Talk about
breaking the software, now USG is breaking the documentation...
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

jim@haring.UUCP (10/24/84)

	> >   The main utility that concerns me is
	> >   "sort", which can really eat up temp space.

	> There is an undocumented flag in the System V sort(1) that allows you
	> to specify the directory where it creates its temp files.
	> Try "sort -T /new/temp/dir ...".  I don't know if it exists in
	> other versions of UN*X, and I don't know why it's not documented.

	> -Alan Bland, ihnp4!druxp!mab, AT&T-ISL Denver

'-T' is a documented flag in 4.2BSD. However, the buffer used to hold
the directory name is only 30 bytes long in size, and caused someone
here heartache a while ago.

Jim McKie    Centrum voor Wiskunde en Informatica, Amsterdam    mcvax!jim