Counting files created in /tmp

Sakari Jalovaara sja at sirius.hut.fi
Sun Feb 4 23:50:18 AEST 1990


> how many files get created in the /tmp subdirectory of Unix on a Sun
> 3/50 or 3/60

How about this: if you are running SunOS 4 you can get an estimate by
modifying the dynamically linked C library.  Write new versions of
open(), creat() and unlink() that first check if the argument file is
in /tmp, write to a trace log, and then do the real system call.
Again, not simple but doable, at least if you have the source to libc.
Depends on how serious you are about getting the statistics...

Statically linked programs (sh, tar etc) escape the statistics.
Files that are unlink()ed but left open are not tracked correctly.
									++sja



More information about the Comp.unix.questions mailing list