Next | Internals of ext2fs | 23 |
One of the items in the inode is a link count
"How many links are there to this file?"
When you unlink a file, the kernel decrements the link count
If the link count is 0, the kernel frees up the data blocks
... unless someone still has the file open
... in which case the data is freed only when the file is closed
This means you can open a file and unlink it
And still read it and write it
unlinking doesn't remove the file; it only removes the name
Next | Copyright © 2001 M. J. Dominus |