This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
rename(2) using NTFS transactions on Vista/2008
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Thu, 15 May 2008 20:03:21 +0200
- Subject: rename(2) using NTFS transactions on Vista/2008
- Reply-to: cygwin-developers at cygwin dot com
Hi,
I just applied a patch (rather, three patches) which uses the new
transactional NTFS (TxF) feature introduced with Vista/2008 to add
atomicity in a few border cases of the rename(2) function. POSIX
requires that rename(2) works atomically, but without the new
transactions, not all cases can be implemented atomically under Windows.
The three border cases are
- The destination file is an existing directory.
- The destination file has the R/O DOS attribute set.
- The destination file exists and does not grant the user DELETE access.
This is an interesting case which I discussed on a Microsoft newsgroup
when I asked about the transaction stuff. For the curious see
http://tinyurl.com/3uh45d, especially the second reply from Jeffrey
Tan :)
Obviously I can't implement these cases atomically on older OSes and
maybe even more obviously atomicity only works on TxF filesystems, but
fortunately that's standard with Vista/2008 and you probably wouldn't
have expected otherwise anyway...
I've uploaded cygwin-1.7.0-10 with this change to the release-2 area.
Here's a request: If you see any other case in Cygwin which should work
atomically, but doesn't right know, please send a mail here. Maybe
these cases can easily run atomically under Vista/2008/TxF, now that I
have the ground work and know how to do it.
Have fun,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat