Mail Archives: cygwin/2003/06/09/15:11:10
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 -