bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fix for rename function on Mingw


From: Ben Pfaff
Subject: Re: fix for rename function on Mingw
Date: Sat, 21 Mar 2009 12:32:21 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

> How does MoveFileEx with MOVEFILE_REPLACE_EXISTING behave when
> the destination file exists and is a hard link [1] to another file? Will
> the other file see some changes? I.e. will the hard linked file be
> overwritten, or will the hard link be broken (as on POSIX systems)?

Michel, is there any chance that you could test this behavior?

Now, also, I see that rename() works to rename directories on
Windows, but MoveFileEx with MOVEFILE_REPLACE_EXISTING will not
rename directories.  I guess that perhaps the solution to this is
to try MoveFileEx with flags of 0 first, and then try again with
MOVEFILE_REPLACE_EXISTING if that reports an error of
ERROR_ALREADY_EXISTS or ERROR_FILE_EXISTS (there is no
documentation on which one is returned).

I'm going away tomorrow morning until March 25, so possibly I'll
have to continue this discussion after that.
-- 
"The road to hell is paved with convenient shortcuts."
--Peter da Silva




reply via email to

[Prev in Thread] Current Thread [Next in Thread]