[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] open-input-file and binary mode

From: Michele La Monaca
Subject: Re: [Chicken-users] open-input-file and binary mode
Date: Sun, 24 Aug 2014 21:05:54 +0200

On Sun, Aug 24, 2014 at 8:04 PM, John Cowan <address@hidden> wrote:
> Michele La Monaca scripsit:
>> ... but binaries do. Yet, open-input-file will open them as text files
>> in Windows and as binaries in Unix (by default).
> The short answer to that is that there is a way of opening binary
> files as binary: with (open-input-file "foo" #:binary) in Chicken,
> open-binary-input-file in R7RS.  In any case, files are opened by
> default as text in both Windows and Posix, though in Posix there is no
> distinction.

On the same page at last. On my first mail I was just asking to make
(open-input-file FILE #:binary) the default behaviour (it is already
so in Unix given there's no such a text mode there). Bad idea?

> What is a genuine restriction, imposed for backward compatibility, is
> that current-input-port and current-output-port initiall refer to text
> mode ports.

Given there is no such a concept in Posix, I guess they fallback to
binary ports on Unix while they are true text ports on Windows. Ouch.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]