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: Fri, 22 Aug 2014 15:06:28 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

Michele La Monaca scripsit:

> AFAICT, Posix systems treat text files as binaries even if you don't
> explicitly say so. Windows does not.

That's true, but the only difference is that CR-LF is mapped to CR
in text mode input and the other way around in text mode output, and ^Z
is treated as EOF in text mode input.

> > In practice the only non-Posix system is raw Windows (i.e. non-Cygwin),
> > and ftell and fseek work fine.
> 
> Microsoft doesn't think so:
> http://msdn.microsoft.com/en-us/library/0ys3hc0b.aspx and I believe my
> example was a clear indication of that.

You're right that seeking to an arbitrary place (as opposed to a place
returned by ftell) in a text file won't work, but then it is hardly
ever useful to do so anyway, because text files typically contain
variable length lines.  In addition, it's unreliable to seek on
current-{in,out}put anyway, and IMO they should be consistent with
open-{in,out}put-file.
> 
> Regards,
> Michele
> 
> >
> > --
> > John Cowan          http://www.ccil.org/~cowan        address@hidden
> > We want more school houses and less jails; more books and less arsenals;
> > more learning and less vice; more constant work and less crime; more
> > leisure and less greed; more justice and less revenge; in fact, more of
> > the opportunities to cultivate our better natures.  --Samuel Gompers

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
But no living man am I!  You look upon a woman.  Eowyn I am, Eomund's daughter.
You stand between me and my lord and kin.  Begone, if you be not deathless.
For living or dark undead, I will smite you if you touch him.



reply via email to

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