[Haskell-cafe] hSeek in Windows

Svein Ove Aas svein.ove at aas.no
Sun Nov 1 16:48:33 EST 2009


On Sun, Nov 1, 2009 at 9:44 PM, Philippos Apolinarius <phi500ac at yahoo.ca> wrote:
> To make a long story short, the program compiles, but does not run. This is interesting, because when Clean compiles an input/output operation it certainly executes it. In any case, what I should do in order to make file operations work on Windows? I need random access to text files.
>
The reason it fails to run is because, on windows, there isn't a
one-to-one mapping between characters and bytes on text files. You
have to use binary mode, in which case you're likely to see doubled
newlines - \r\n, or the other way around, I don't remember.

Which brings up the interesting question of how this works in 6.12,
which has text support for modes that are 1:N on /all/ platforms; e.g.
UTF-8. If hSeek works there, then chances are it'll work in text mode
on windows as well.

--
Svein Ove Aas


More information about the Haskell-Cafe mailing list