I'm having a little difficulty understanding how exactly this works.
It seems that unlink()
will remove the inode which refers to the file's data, but won't actually delete the data. If this is the case,
a) what happens to the data? Presumably it doesn't stick around forever, or people would be running out of disk space all the time. Does something else eventually get around to deleting data without associated inodes, or what?
b) if nothing happens to the data: how can I actually delete it? If something automatically happens to it: how can I make that happen on command?
(Auxiliary question: if the shell commands rm
and unlink
do essentially the same thing, as I've read on other questions here, and Perl unlink
is just another call to that, then what's the point of a module like File::Remove
, which seems to do exactly the same thing again? I realize "there's more than one way to do it", but this seems to be a case of "more than one way to say it", with "it" always referring to the same operation.)
In short: can I make sure deleting a file actually results in its disk space being freed up immediately?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…