[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: REMOVING THE DIRECTORY IN WHICH YOU ARE(REDHAT LINUX 9)
From: |
Eric Blake |
Subject: |
Re: REMOVING THE DIRECTORY IN WHICH YOU ARE(REDHAT LINUX 9) |
Date: |
Sat, 07 Apr 2007 14:16:12 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to rohit sharma on 4/7/2007 11:40 AM:
> but how is it possible to remove the directory in which you are
POSIX does not require this, but also does not forbid it. On some
implementations (cygwin, for example), it is impossible to remove a
directory that is in use by any process; and this includes being in use by
virtue of being the current working directory. On other implementations,
such as Linux, removing the directory does not free up any disk resources
as long as a process still has a reference to the inode occupied by that
directory, but the rmdir still succeeds by updating the parent directory
to state that the directory is no longer reachable via the filesystem.
Then, when all processes that use the unlinked directory have exited, the
filesystem can finally reclaim the disk space that the removed directory
occupied.
In short, there is nothing inherently wrong with deleting your current
working directory if that is what the implementation decided. And Linux
decided to implement things that way.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGF/wL84KuGfSFAYARAidlAJ4vsnjIH8iB4gFjtVaTzYUPGi/QigCZAYyR
l6imFklUa8ILdug+EAP1zMs=
=XMCI
-----END PGP SIGNATURE-----