Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!mips!apple!rutgers!rochester!ken From: ken@cs.rochester.edu (Ken Yap) Newsgroups: comp.unix.questions Subject: Re: Counting files created in /tmp Message-ID: <1990Feb3.184931.3706@cs.rochester.edu> Date: 3 Feb 90 18:49:31 GMT References: <22031@unix.cis.pitt.edu> <1990Jan31.164539.355@deimos.cis.ksu.edu> <5423.25c5bd70@elroy.uh.edu> <21993@unix.cis.pitt.edu> <1990Jan31.183313.17636@athena.mit.edu> <1990Feb2.043501.14826@athena.mit.edu> <22047@unix.cis.pitt.edu> Reply-To: ken@cs.rochester.edu Organization: University of Rochester Computer Science Department Lines: 11 Address: Rochester, NY 14627, (716) 275-1448 I don't know exactly what the person wants to do with stats from /tmp, I had some mail from him, but it wasn't totally clear what sorts of stats he wanted, but I want to point out that not all files in /tmp have names. A neat trick to avoid leaving /tmp files around when a program crashes is to do this at creation time. fd = creat(name, mode); /* or open with O_CREAT */ unlink(name); Now the file is nameless and can only be accessed via the fd. It will go away as soon as nobody is referencing it.