delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/13/07:37:55

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
X-PGP-Universal: processed
Message-ID: <8904DDEEB811D6118AF900508BB832FA080995E0@the-exch-c.ai.pri>
From: Nuno Leitao <nuno DOT leitao AT integralis DOT com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Buffered output/Forked processes
Date: Wed, 13 Oct 2004 12:31:06 +0100
MIME-Version: 1.0
X-IsSubscribed: yes

  Hi,

  I have a Perl script which looks like:

  open( VMSTAT, "vmstat 5|" );
  VMSTAT->autoflush( 1 );
  while( <VMSTAT>) {
     print $_;
  }

  Now, under Linux and other UNIX OS's this works fine, and "print $_" will
print the vmstat output every 5 seconds since the output from vmstat is not
buffered. Under Cygwin however, it seems vmstat will always buffer its
stdout with the undesirable effect that lines come in batches as the output
buffer gets full and is flushed by the Cygwin C libraries.

  Is there a way to go around this without having to patch and recompile
vmstat or other binaries I might want to use in this way ?

  Thanks and best regards,

--Nuno.


Please note that:
 
1. This e-mail may constitute privileged information. If you are not the intended recipient, you have received this confidential email and any attachments transmitted with it in error and you must not disclose, copy, circulate or in any other way use or rely on this information.
2. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices.
3. The contents of this email are those of the individual and do not necessarily represent the views of the company.
4. The company does not conclude contracts by email and all negotiations are subject to contract.
5. The company accepts no responsibility once an e-mail and any attachments is sent.

http://www.integralis.com


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