How exactly to cancel the work?

It’s hard for me to understand how exactly this works.

It seems to unlink()delete the index that refers to the file data, but will not actually delete the data. If it is true,

a) what happens to the data? Presumably, it does not stick out forever, or people will run out of disk space all the time. Can something else finally delete data without associated indices or what?

b) if nothing happens to the data: how can I delete it? If something happens to him automatically: how can I do this on command?

(Ancillary question: if the shell commands rmand unlinkdo, in fact, the same thing as I read on other issues here, and Perl unlinkis another challenge to this, then which point from a module, such as File::Removeone that seems to repeat that the same thing? I understand "there is more than one way to do this," but this is apparently the case of "more than one way of saying this," he "always refers to the same operation.)

In short: can I make sure that deleting the file actually leads to the immediate release of disk space?

+4
source share
3 answers

- , . . . unlink . , inode . , , , .

- . , , - , ( , , / ).

+10

unlink() (, , - ) ( inode). , . inode. ls -l, :

789994 drwxr-xr-x+  29 john  staff      986 11 nov  2010 SCANS
 23453 -rw-r--r--+   1 erik  staff      460 19 mar  2011 SQL.java

, inode 789994 29 inode 23453 1. SQL.java - , inode 23453, ( unlink rm), 0 space, , 0, , / ! , .

+2

, . /, - . , .

+1

All Articles