[Haskell-cafe] Re: Darcs and NFS Resolution

Ganesh Sittampalam ganesh at earth.li
Sat Sep 12 18:24:52 EDT 2009


On Sat, 12 Sep 2009, Brandon S. Allbery KF8NH wrote:

> On Sep 12, 2009, at 11:22 , Trent W. Buck wrote:
>> Jason Dagit <dagit at codersbase.com> writes:
>>>> which ensures that when the operating system is not WIN32, that
>>>> renaming of files will be performed by the OS shell.
>> 
>> I'm also puzzled as to why this works -- surely mv(1) assumes POSIX
>> semantics, too?  I would be interested in seeing the exact error
>> transcript, preferably as an issue on bugs.d.n.  I'm not sure the
>> problem has been diagnosed correctly.
>
> In order to handle the case where you're moving across filesystems, mv(1) 
> gracefully degrades to cp + rm.  rename(2) does not.  This also happens to 
> work around compatibility issues with native CIFS (and possibly older HP/UX, 
> not that anyone likely cares).

I don't think that darcs is ever likely to want to do a move across 
filesystems - unless someone has actually put a mount point in the middle 
of their darcs repo (and perhaps not even then for the metadata operations 
such as the one that was failing here, as I think those are all inside a 
single directory).

Darcs already has a WIN32-specific workaround for renaming going wrong 
when the new file exists, and my initial guess was that was what was going 
wrong here. The workaround just tries to remove the new file and retries 
the rename. The original poster doesn't make clear whether he tried my 
suggested fix enabling that workaround unconditionally before resorting to 
shelling out.

Cheers,

Ganesh


More information about the Haskell-Cafe mailing list