[darcs-devel] [issue1015] wrong assumptions about System.Posix.Files.fileSize
Eric Kow
bugs at darcs.net
Mon Aug 18 15:01:23 UTC 2008
New submission from Eric Kow <eric.kow at gmail.com>:
This sounds pretty bad, although it does not seem like anything particularly new
to darcs (is it?)
I'm adding Petr to this bug, because the question of types associated with the
struct stat vaguely reminds me of the work he did for
http://bugs.darcs.net/issue973 (the resolution of which was to tell people to
upgrade to GHC 6.8.3)
Also, I wonder how the unix-compat package handles this
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/unix-compat
and if it would not be prudent to start using it instead of our own custom wrapper.
Finally, Simon: please send patches in whatever form. At the very least, it'll
give us an idea of the right way to fix this.
>From Simon Marlow on darcs-users:
> System.Posix.Files has confusion about COff, which on Windows is Int32, but
> since we're using stat64() on Windows the st_size field of struct stat is an
> Int64.
>
> All over the place darcs assumes that fileSize returns a COff, which it
> doesn't on Windows. I suppose we need a type that corresponds to COff on Unix
> and Int64 on Windows, and use that instead of FileOffset.
>
> I'm a bit ignorant of how the whole configuration system works in darcs,
> so while I could fix this up with a few #ifdefs I'm sure the patch would
> probably be rejected because it needs autoconf tests or whatever. So I'll
> leave this for now (if someone wants to tell me the right way to fix it I might
> find time to do it later).
----------
messages: 5578
nosy: beschmi, dagit, eivuokko, jaredj, kowey, mornfall, simonmar, wglozer
priority: critical
status: unread
title: wrong assumptions about System.Posix.Files.fileSize
topic: ReleaseCritical_2.0.3, Windows
__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1015>
__________________________________
More information about the darcs-devel
mailing list