Is it possible for a directory to get unlinked while its contained files remain?

Posted by Walkerneo on Super User See other posts from Super User or by Walkerneo
Published on 2012-06-29T15:11:19Z Indexed on 2012/06/29 15:18 UTC
Read the original article Hit count: 290

Filed under:
|
|
|
|

I used to wonder why deleting directories via PHP or shell wasn't as easy as it was in Windows with just clicking delete. I realize now that deleting is simply unlinking files from the file allocation table, so to delete a directory, you must unlink all the files inside it.

Is it ever possible for the directory's entry to be removed, but not those of the files inside it? Do operating systems periodically check for files that can't be reached in the file system?

© Super User or respective owner

Related posts about file

Related posts about operating-systems