AFAIK Linux removes the directory entry and reduces the reference count of Inode of a running process and rm is successful. So, you can't see it in the file system anymore. However as the program is still running the inode reference count is still not zero and so the Inode and hence file is actually not deleted yet. When the program will terminate, Inode ref count will drop to zero and in that case the Inode and file will be freed. <div>
<br><div>"The design of Unix Operating System" by Maurice J. Bach It covers these basic design principles in good detail.<br>
<br><br><div class="gmail_quote">On Tue, May 31, 2011 at 10:12 AM, Manish Katiyar <span dir="ltr"><<a href="mailto:mkatiyar@gmail.com">mkatiyar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Mon, May 30, 2011 at 8:45 PM, Mulyadi Santosa<br>
<<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>> wrote:<br>
> hi..<br>
><br>
> On Tue, May 31, 2011 at 09:57, Manish Katiyar <<a href="mailto:mkatiyar@gmail.com">mkatiyar@gmail.com</a>> wrote:<br>
>> How will "rm /bin/rm" work otherwise ?<br>
><br>
> ok, makes me think another case....suppose we erase the related data<br>
> blocks in the disk that correlate to running binary.... does Linux<br>
> kernel follow that with erasing all the related page cache? or is it<br>
> possible that temporarily cache of the disk blocks still survived?<br>
<br>
I don't know for sure, but my guess is that the OS wouldn't notice it<br>
till it goes out of cache and it has to reload.<br>
<font color="#888888"><br>
--<br>
Thanks -<br>
Manish<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</font></blockquote></div><br></div></div>