This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unable to delete directory in Cygwin

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

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.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]