delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/09/15:11:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3EE4DBB8.612DDA8D@arrayinc.com>
Date: Mon, 09 Jun 2003 15:10:48 -0400
From: Don Slutz <dslutz AT arrayinc DOT com>
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Updated: Perl 5.8.0-3 breaks binmode()

This update breaks the usage of binmode(FH).  I am sure that:

> News:  Changes: - Moved Cygwin to the non DOSish platforms.

is the main reason.   Last time I was in the perl sources, I saw that
perl
only expected two types of file opens; text or binary.  However cygwin
supports 3: default, text, and binary.

I would expect that declaring cygwin to be like VOS (text open is
different
then binary open; but do not change end of line handling) would be the
fix.

I have also found that | some times does things to end of lines also.

Here is output of some tests that I ran to validate this issue (tests
are available
via direct e-mail):

test/txt/idos test/txt/odos-binmode differ: char 3, line 1
test/txt/idos
0000000   1  cr  nl   2  cr  nl
0000006
test/txt/odos-binmode
0000000   1  cr  cr  nl   2  cr  cr  nl
0000010

Which is the output from:

#! /usr/bin/perl -w

$line = 0;
open(I,"<$ARGV[0]");
binmode(I);
open(O,">$ARGV[1]");
binmode(O);
while(<I>) {
  $line++;
  print O;
}
close (I);
close (O);
# print "Lines: $line\n";

   -Don Slutz


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019