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 17:03:50 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

>> Bruno Haible 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)?

> Ben Pfaff writes:
>> Michel, is there any chance that you could test this behavior?

Michel Boaventura <address@hidden> writes:
> On Windows there is no link as on linux. The link file on windows is
> just a regular file with
> the address of the original on it. So I don't know how to test it on windows.

Windows does support real hard links, although this feature is
not well known.  There is information on how to create them under
Windows at:
        http://en.wikipedia.org/wiki/Hard_link
as Bruno pointed out earlier.

The test would be something like this:

        * Create file A with some contents.
        * Create file B with some other contents.
        * Create a hard link from A to a new name C.
        * Rename B to C using MoveFileEx (MOVEFILE_REPLACE_EXISTING).
        * Does A now have its original contents or B's original
          contents?

Thanks!
-- 
Peter Seebach on managing engineers:
"It's like herding cats, only most of the engineers are already
 sick of laser pointers."





reply via email to

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