chicken-users
[Top][All Lists]
Advanced

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

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


From: John Cowan
Subject: Re: [Chicken-users] open-input-file and binary mode
Date: Sun, 24 Aug 2014 14:04:55 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

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.  Rarely, if ever, does an application not know if a file
it is opening is to be processed as text or as binary, and applications
that are insensitive to the content of a file (like "cat") can always
use the binary operations.

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

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
"Make a case, man; you're full of naked assertions, just like Nietzsche."
"Oh, i suffer from that, too.  But you know, naked assertions or GTFO."
                        --heard on #scheme, sorta



reply via email to

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