15mb file exist but doesn't appear in ls or find

Clarence Dold dold at mitisft.Convergent.COM
Mon Sep 10 13:10:58 AEST 1990


in article <4887 at alpha.cam.nist.gov>, coleman at cam.nist.gov (Sean Sheridan Coleman X5672) says:

> ~ 15mb. When I ran mail, my /tmp directory reduced in size by 15mb but I can't
> find a single file that is 15mb large. I found the inode number of the file 
> but doing a find -inum in /tmp, that file didn't show. What gives?

You can fopen(), or create a file in any manner you'd care to, and immediately
unlink it.  This leaves it occupying space on disk, with an inode, but no name.
tmpfile(3S) does just that.  The advantage is that a "scratch" file will be
removed when your program terminates for any reason (the last close of a file
with no links (names)).  
-- 
---
Clarence A Dold - dold at tsmiti.Convergent.COM            (408) 435-5293
               ...pyramid!ctnews!tsmiti!dold        FAX (408) 435-3105
               P.O.Box 6685, San Jose, CA 95150-6685         MS#10-007



More information about the Comp.unix.internals mailing list