This is the mail archive of the cygwin@cygwin.com 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]

Buffered IO curiosity effects non-CYGWIN programs.


There were no replys to my question about buffered IO.

Write a 14 line program reading lines from stdin and printing them to
stdout. Compile with Microsoft CL.exe. Run the program from bash and it
runs as if buffering were turned on. It doesn't recognize the console as an
interactive output requiring immediate flushing. Run the very same program
from cmd.exe and it works correctly.

This is a bug in something because it effects programs that are not
compiled with CYGWIN. Has anyone seen this problem and is there any type of
resolution?

Thank you.
Ed Bradford

#include <windows.h>
#include <stdio.h>
main()
{
    char buf[128];

    while(fgets(buf,sizeof(buf),stdin)) {
        buf[127] = 0;
        printf("%s\n",buf);
        if(buf[0] == 'q')
            break;
    }
    return 0;
}


Your Windows 2000 Arborist and Linux Performance Comparisonist
T/L 589-4410; Outside: 1-919-993-4410
egb@us.ibm.com




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]