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

Conor P. Cahill cpcahil at virtech.uucp
Sun Sep 9 22:47:28 AEST 1990


In article <4887 at alpha.cam.nist.gov> coleman at cam.nist.gov (Sean Sheridan Coleman X5672) writes:
>I own a SparcStation 1+ running 4.1 SunOS. I created a large mail folder of 
>~ 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?

The file probably has been removed but is still open by some process.  When a 
file is removed (unlinked(2)) and there are no file system hard links to that
file, the directory entry is removed from the directory.  If there are any   
processes that have that file open, the file will continue to exist until all
of the processes accessing the file close it.

>On the same line, if the content of my large file is in /tmp physically, hoe
>can a programmer write code to do a similar operation, ie put data on a disk
>without creating a file?

Actually you create the file (thereby having an open file descriptor) and 
ulink it immediatly.  The file will be gone (no other program can get to it)
and when your process closes the file (or the kernel closes it when your
program exits) the data associated with the file will go away.

>Are there other ideas out there to do this sort?

Yes:

	1. use a mailer that allows you to specify a sorted order (like ELM)
	2. sort the data into a second file and then replace the original
	   file with the sorted file.


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.internals mailing list