[I haven't taken a close look at the CVS 1.10.3 and WinCVS 1.0 rename_file, given below, compare. The report was that this kind of problem happens with Win98/NT only, not Win95 (maybe Win98 and NT are more like OS/2, in the sense of being consistently picky about trying to operate on an open file). March 1999 update: Olaf Brandes reports the same symptom (that the problem occurs only on conflicts), but suspects copy_file is being called with the file open. That seems more plausible in the sense that the CVS 1.10.3 rename_file would seem to be dealing with the case in question. Should be fixed by Larry Jones checkin to diff/diff3.c on 1999-03-24. -kingdon] From: "Olaf Brandes" Date: Fri, 22 Jan 1999 16:38:00 +0100 Subject: Win: Renaming files even with Novell (Was: Re: that ",foo," file CC: info-cvs@gnu.org Hello all, Jim Kingdon wrote: > CVS is trying to set the foo,v file to read/write before it tries to > rename the ,foo, file over it. So perhaps someone would like to look > more into what is going on and why the code doesn't seem to be > working. We are using CVS under Win32 and intended to upgrade from cvs 1.9.16 to 1.10.3. 1.9.16 works somewhat fine in our Novell network, apart from leaving some ".#foo" files laying around when merging differences and not rebuilding the administrative database, which we lived with for a while. At first, 1.10.3 seemed to work fine, but then there was this well-known "permission denied" problem when a conflict arose for the first time. I took a look at what WinCvs 1.0 does and found this: CVS 1.10.3 -----8<----- /* * Rename a file and die if it fails */ void rename_file (from, to) const char *from; const char *to; { if (trace) #ifdef SERVER_SUPPORT (void) fprintf (stderr, "%c-> rename(%s,%s)\n", (server_active) ? 'S' : ' ', from, to); #else (void) fprintf (stderr, "-> rename(%s,%s)\n", from, to); #endif if (noexec) return; /* Win32 unlink is stupid --- it fails if the file is read-only */ chmod(to, S_IWRITE); unlink(to); if (CVS_RENAME (from, to) < 0) error (1, errno, "cannot rename file %s to %s", from, to); } -----8<----- WinCvs 1.0: -----8<----- /* * Rename a file and die if it fails */ void rename_file (from, to) const char *from; const char *to; { int wasLocked; if (trace) #ifdef SERVER_SUPPORT (void) fprintf (stderr, "%c-> rename(%s,%s)\n", (server_active) ? 'S' : ' ', from, to); #else (void) fprintf (stderr, "-> rename(%s,%s)\n", from, to); #endif if (noexec) return; /* Win32 unlink is stupid --- it fails if the file is read-only */ chmod(to, S_IWRITE); /* And Netware as well is stupid ! (report of Norbert,Klamann@pobox.com) */ wasLocked = !iswritable (from); chmod (from, S_IWRITE); unlink(to); if (CVS_RENAME (from, to) < 0) error (1, errno, "cannot rename file %s to %s", from, to); if(wasLocked) { chmod(to, S_IREAD); } } -----8<----- [Snipped unrelated discussion of get_homedir() -kingdon] Best regards, Olaf Brandes -- +--------------------------------------------------------------+ | EKB telecommunication AG Olaf Brandes | | Provinzstrasse 45/56 Fon: (+49 30) 49975 - 146 | | 13409 Berlin Fax: (+49 30) 49975 - 175 | | Germany email: Olaf.Brandes@ekb.de | +--------------------------------------------------------------+