[darcs-users] Heads up: breaking Windows 9x some more

Simon Marlow simonmar at microsoft.com
Mon Dec 11 10:00:32 UTC 2006


Eric Y. Kow wrote:
> On Sat, Dec 09, 2006 at 20:10:58 -0500, Nathan Gray wrote:
>>> I'm about to accept a patch by Simon Marlow which adds hard-linking
>>> support over NTFS in Windows.  Unfortunately, this rules out the use
>>> of darcs on Windows9x.
>>
>> Is the problem with Windows or with FAT filesystems?  What about
>> running off FAT from Linux, like on a USB stick?
>
> Very good question (and point)
>
> The code looks like this:
>
>     result = CreateHardLink(src, dst, NULL);
>     if (!result)
>         return 0;
>     else
>         return -2;
>
> It has have provisions for hard linking to fail, which would
> lead me to
> think that over FAT it would just not create hard links and that darcs
> would sitll work on FAT under Windows 2000 and above.  Care
> to confirm, Simon?

Yes, spot on.  It'll silently fail to create the hard link on filesystems that don't support it, or across volumes.

The problem on WinME and earlier is that the CreateHardLink() function did not exist at all, so even if we were to add some configure magic to detect it, you'd still end up with a binary that only supports Win 200+.  There's a way around this: we can use explicit dynamic-linking, see for example GHC's implementation of getFolderPath:

 http://darcs.haskell.org/packages/base/cbits/dirUtils.c

Cheers,
        Simon




More information about the darcs-users mailing list