This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Buffered output/Forked processes


  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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]