public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Buffered IO curiosity effects non-CYGWIN programs.
@ 2001-07-24  7:13 Glen Coakley
  0 siblings, 0 replies; 3+ messages in thread
From: Glen Coakley @ 2001-07-24  7:13 UTC (permalink / raw)
  To: cygwin

Are you certain this is not a feature of the terminal system in Cygwin?
It would be my bet that it does buffering by default and cmd.exe (though it
is undoubtably designed and written so well, ahem!) does not.

________________________________
Glen Coakley, Sr. Software Engineer
MQSoftware Inc., (763) 543-4845
"Tinkero ergo sum." -- Chuck Murcko


> -----Original Message-----
> From: Ed Bradford [ mailto:egb@us.ibm.com ]
> Sent: Tuesday, July 24, 2001 9:07 AM
> To: cygwin@cygwin.com
> Subject: 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/
> 

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Buffered IO curiosity effects non-CYGWIN programs.
  2001-07-24  7:06 Ed Bradford
@ 2001-07-24 10:16 ` Andrej Borsenkow
  0 siblings, 0 replies; 3+ messages in thread
From: Andrej Borsenkow @ 2001-07-24 10:16 UTC (permalink / raw)
  To: Ed Bradford; +Cc: cygwin

On Tue, 24 Jul 2001, Ed Bradford wrote:

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

It is very interesting definition of "bug". "Bug" is when program behaves
differently as designed. Nobody ever claimed that Cygwin was designed to
transparently run Win32 applications.

Cygwin terminal is not Win32 console. I do not know if it is somewhere in
FAQ (cannot check at this moment) but it probably should be.

There is a program from Egor Duda that may help, it is called ttyfier.
Search archives. I have not tried it myself.

-andrej




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Buffered IO curiosity effects non-CYGWIN programs.
@ 2001-07-24  7:06 Ed Bradford
  2001-07-24 10:16 ` Andrej Borsenkow
  0 siblings, 1 reply; 3+ messages in thread
From: Ed Bradford @ 2001-07-24  7:06 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-24 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-24  7:13 Buffered IO curiosity effects non-CYGWIN programs Glen Coakley
  -- strict thread matches above, loose matches on Subject: below --
2001-07-24  7:06 Ed Bradford
2001-07-24 10:16 ` Andrej Borsenkow

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