delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/19/13:03:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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: <432EEF4A.4070805@familiehaase.de>
Date: Mon, 19 Sep 2005 19:03:06 +0200
From: "Gerrit P. Haase" <gerrit AT familiehaase DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.11) Gecko/20050728
MIME-Version: 1.0
To: ohsie_david AT emc DOT com
CC: cygwin AT cygwin DOT com
Subject: Re: perl 5.8.7-4: pipe from cmd.exe hangs
References: <8FCA699EF0898345A5D828F02A55511B8A0E64 AT CORPUSMX40B DOT corp DOT emc DOT com>
In-Reply-To: <8FCA699EF0898345A5D828F02A55511B8A0E64@CORPUSMX40B.corp.emc.com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j8JH3fBP017300

ohsie_david AT emc DOT com wrote:

> Dear All,
> 
> The following perl program calls out to the Windows command shell to "type"
> the contents of a file and then prints the contents of the file.
> 
> The program hangs at the "open" statement whenever the input file is larger
> than 12328 bytes on my Win2K installation.  It will work for smaller files.
> 
>   ($#ARGV == 0) || die "Usage type.pl <filename>";
>   open (FILEIN, "cmd /c type $ARGV[0] |") || die "open failed";
>   print "Open succeeded";
>   while (<FILEIN>)
>   {
>     print $_;
>   }
> 
> I tried this program on Windows XP and it was able to handle a file up to
> 16384 bytes in size.   If "cmd /c type" is replace with "cat", then the
> program works fine.  I also tried this with an older cygwin perl version
> 5.8.2-1 and it works fine. 
> 
> The problem was discovered when running a "makedepend" program implemented
> in perl that invokes the Microsoft C++ compiler to do the C preprocessing.
> When I upgraded from a ~2 year old cygwin distribution to the current one,
> this problem cropped up.
> 
> Cygcheck output is embedded below.
> 
> I appreciate any light that people on the list can shed on this problem.

I can confirm that it works with perl 5.8.6-4 and cygwin 1.5.17 and it
doesn't work with perl 5.8.7-4 on cygwin 1.5.18.

Please tried a recent snapshot -> http://cygwin.com/snapshots/, i.e. it
should work with todays snapshot (2005-09-19).


Works ok:

$ uname -a
CYGWIN_NT-5.0 ismene 1.5.17(0.129/4/2) 2005-05-25 19:38 i586 unknown 
unknown Cygwin

$ cygcheck -c perl
Cygwin Package Information
Package              Version        Status
perl                 5.8.6-4        OK

$ cat open.pl
#!/usr/bin/perl
($#ARGV == 0) || die "Usage type.pl <filename>";
print "File to open: $ARGV[0]\n";
open (FILEIN, "/c/WINNT/system32/CMD.EXE /c type $ARGV[0] |") || die 
"open failed";
print "Open succeeded\n";
while (<FILEIN>)
{
   print $_;
}

$ perl -e 'open (FILE,">open.txt"); for ($i=0;$i<112329;$i++) { print 
FILE "a" }; close FILE'

$ ls -l open.txt
-rw-rw-rw-  1 gerrit Domänen-Admins 112329 Sep 19 18:46 open.txt

$ ./open.pl open.txt
File to open: open.txt
Open succeeded
aaaaaaaaaaaaaa.....


Works nok:

$ uname -a
CYGWIN_NT-5.1 INSPIRON 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown 
unknown Cygwin

$ cygcheck -c perl
Cygwin Package Information
Package              Version        Status
perl                 5.8.7-4        OK


Thanks for the report,
Gerrit
-- 
=^..^=


--
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