No subject
Tue Aug 30 15:12:41 CDT 2005
"The new name must not be the name of an existing file or directory.
You can use rename to move a file from one directory or device to another
by giving a different path in the newname argument."
This clearly says that MOVEFILE_REPLACE_EXISTING should _not_ be set,
while MOVEFILE_COPY_ALLOWED is necessary to allow moving files between
drives. I have verified that windows actually behaves as stated in the
MSDN excerpt above. Perhaps someone knows why the flags have been set
this way - is it a workaround for some hidden feature in some Windows version?
Index: dlls/msvcrt/file.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/file.c,v
retrieving revision 1.37
diff -u -r1.37 file.c
--- dlls/msvcrt/file.c 12 Sep 2002 22:28:01 -0000 1.37
+++ dlls/msvcrt/file.c 16 Sep 2002 09:16:07 -0000
@@ -2107,7 +2107,7 @@
int MSVCRT_rename(const char *oldpath,const char *newpath)
{
TRACE(":from %s to %s\n",oldpath,newpath);
- if (MoveFileExA(oldpath, newpath, MOVEFILE_REPLACE_EXISTING))
+ if (MoveFileExA(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
return 0;
TRACE(":failed (%ld)\n",GetLastError());
MSVCRT__set_errno(GetLastError());
@@ -2120,7 +2120,7 @@
int _wrename(const WCHAR *oldpath,const WCHAR *newpath)
{
TRACE(":from %s to %s\n",debugstr_w(oldpath),debugstr_w(newpath));
- if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING))
+ if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
return 0;
TRACE(":failed (%ld)\n",GetLastError());
MSVCRT__set_errno(GetLastError());
--
Martin Wilck Phone: +49 5251 8 15113
Fujitsu Siemens Computers Fax: +49 5251 8 20409
Heinz-Nixdorf-Ring 1 mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn http://www.fujitsu-siemens.com/primergy
More information about the wine-patches
mailing list