From: Don Slutz <dslutz@arrayinc.com>
To: "'Gerrit P. Haase'" <gp@familiehaase.de>,
Don Slutz <DSlutz@arrayinc.com>,
cygwin@cygwin.com
Subject: Re: Updated: Perl 5.8.0-3 breaks binmode()
Date: Wed, 25 Jun 2003 16:53:00 -0000 [thread overview]
Message-ID: <3EF9C0D8.C90637A9@arrayinc.com> (raw)
In-Reply-To: <1F7DF2D5EE161D4ABD7371B32CA91ED6582633@mail.arrayinc.com>
I have found a change (patch) that will make stdio work the same as perlio.
Both are broken for text mounts in that they force binary mode. The is a
bug/feature in fgetc/fopen in the way perl uses them that prevents text mode
from working on read, but works on write.
Here are the diff files:
diff -ur perl-5.8.0~/perlio.c perl-5.8.0/perlio.c
--- perl-5.8.0~/perlio.c 2002-07-11 12:39:36.000000000 -0400
+++ perl-5.8.0/perlio.c 2003-06-17 16:06:39.000000000 -0400
@@ -2484,7 +2484,7 @@
while (*mode) {
*tmode++ = *mode++;
}
-#ifdef PERLIO_USING_CRLF
+#if defined(PERLIO_USING_CRLF) || defined(__CYGWIN__)
*tmode++ = 'b';
#endif
*tmode = '\0';
@@ -2585,15 +2585,15 @@
fd = PerlLIO_open3(path, imode, perm);
}
else {
- FILE *stdio = PerlSIO_fopen(path, mode);
+ FILE *stdio = PerlSIO_fopen(path,
+ (mode = PerlIOStdio_mode(mode, tmode)));
if (stdio) {
PerlIOStdio *s;
if (!f) {
f = PerlIO_allocate(aTHX);
}
if ((f = PerlIO_push(aTHX_ f, self,
- (mode = PerlIOStdio_mode(mode, tmode)),
- PerlIOArg))) {
+ mode, PerlIOArg))) {
s = PerlIOSelf(f, PerlIOStdio);
s->stdio = stdio;
PerlIOUnix_refcnt_inc(fileno(s->stdio));
Which causes stdio to open ALL files/pipes/etc in binary mode. (Which is
the same thing that perlio/unix does...)
-Don Slutz
Don Slutz wrote:
> Nope, I no longer have the perl 5.6.0 patch I was working on (lost the
> disk it was on) and found that binmode() would get around the issue and
> so got put on the back burner...
>
> I will take a quick look at the latest source via setup and see if I can
> figure out the 5.8 version...
>
> I have attached the test files.
>
> -Don
>
> -----Original Message-----
> From: Gerrit P. Haase [mailto:gp@familiehaase.de]
> Sent: Monday, June 09, 2003 6:12 PM
> To: Don Slutz
> Cc: cygwin@cygwin.com
> Subject: Re: Updated: Perl 5.8.0-3 breaks binmode()
>
> Hallo Don,
>
> > 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.
>
> Where and what to apply? Do you have a patch handy for me to test
> with?
>
> > 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):
>
> Yes, please send me your tests.
>
> Gerrit
> --
> =^..^=
>
> ------------------------------------------------------------------------
>
> Part 1.2 Type: application/ms-tnef
> Encoding: base64
--
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/
next parent reply other threads:[~2003-06-25 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1F7DF2D5EE161D4ABD7371B32CA91ED6582633@mail.arrayinc.com>
2003-06-25 16:53 ` Don Slutz [this message]
2003-06-09 19:10 Don Slutz
2003-06-09 22:15 ` Gerrit P. Haase
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EF9C0D8.C90637A9@arrayinc.com \
--to=dslutz@arrayinc.com \
--cc=cygwin@cygwin.com \
--cc=gp@familiehaase.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).