[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: always O_BINARY?
From: |
Ludovic Courtès |
Subject: |
Re: always O_BINARY? |
Date: |
Sun, 24 Feb 2013 22:17:55 +0100 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Hi!
Andy Wingo <address@hidden> skribis:
> Just thinking aloud here -- Windows has this O_BINARY thing that
> translates CRLF to LF when reading, and LF to CRLF when writing. It
> seems to me to be a useless thing. We already have our own i/o
> abstractions and should deal with CRLF vs LF in Scheme, I think:
Yes.
> The (newline) function can write CRLF
> The ~% format directive should DTRT
> read-line should DTRT
IMO the correct abstraction here is transcoders à la R6RS. The problem
is that scm_t_port doesn’t have any slot to specify the EOL style, but
it would need one.
> So, what do you think about always adding O_BINARY to files that Guile
> opens?
Yes, but only when there’s a per-port EOL style, since otherwise we’d
just remove functionality, no?
Ludo’.