X-Spam-Check-By: sourceware.org
Message-ID: <a5f030530606160435o3a8cdd3bne0c4899cbeebdfad@mail.gmail.com>
Date: Fri, 16 Jun 2006 07:35:27 -0400
From: "Brett Serkez" <bserkez@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Unable to delete directory in Cygwin
In-Reply-To: <143umqixuj7aa$.q6uf55wgjg5t$.dlg@40tude.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <1F211FE03383644EAA6BB7A52FCD9B9B0927A0@sohm.kpit.com> 	 <1F211FE03383644EAA6BB7A52FCD9B9B0927A4@sohm.kpit.com> 	 <143umqixuj7aa$.q6uf55wgjg5t$.dlg@40tude.net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

<snip>
> mkdir test && cd test && rmdir ../test
> does work in Linux but not under Windows and therefor not under
> Cygwin.

This works under Linux/UNIX as the rmdir removes the directory entry,
disassociating it from the inode, the files still exist as the OS is
using the inode as the handle.  When this disassociation from the
inode occurs, the link count in the inode is decremented.  When the
files and directory finally close, the OS sees that the link count is
zero and physically deletes the directory and files.

This notion of an inode and directory entry pointing to the inode is
what allows hardlinks in Linux/UNIX.  The notion of deleting the
directory entry while a file is still open is a long used trick to
make sure that temporary files are never accidentally reopened
unintentionally and insures deletion (zero link count) should the
process or OS crash.

> Cygwin can't break Windows rules. Under Linux you can name a file c:,
> under Windows and under Cygwin not.

NTFS and FAT file systems simply do not have the concept of inodes,
Cygwin is dependent upon the facilities supplied by these file
systems.

Brett

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

