Perl, text files, & \r

Michael A. Chase mchase@ix.netcom.com
Sun Jul 8 12:26:00 GMT 2001


----- Original Message -----
From: "Gerrit P. Haase" <gp@familiehaase.de>
To: "Christopher Rath" <christopher@rath.ca>
Cc: <cygwin@cygwin.com>
Sent: Sunday, July 08, 2001 06:40
Subject: RE: Perl, text files, & \r


> Christopher Rath schrieb am 2001-07-07, 23:13:
>
> > solution: use of the 'binmode' command.
>
> Would it help to set the environment settings CYGWIN=binmode ?
>
> [...]
> > I think this should be in the Cygwin FAQ.  Why this works can be found
on
> > pp. 53-55 and 147 of "Programming Perl 2nd Ed."
>
> Is it a cygwin issue or more a perl one?
> You can choice at setup time between 'unix(==binmode)' and
> 'windows(==textmode)' mode.
> You could mount with '-b' for binmode.
> It should work as it does on unixlike systems if you setup
> with binmode as default.

It's really a portable programming issue which affects Perl, Python, C, ...

If you know a file needs to be read or written without text modification, it
should be opened in binary mode or set to binary mode as early as possible.
The mount and CYGWIN binmode and textmode options are workarounds for
programs that didn't take that into account when they were originally
written.

--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list