lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
***BOGO*** Re: [Mingw-users] ANSI escape sequences problem
- Date: Tue, 24 Jun 2008 03:53:44 -0700
- From: Brian Dessent <brian@xxxxxxxxxxx>
- Subject: ***BOGO*** Re: [Mingw-users] ANSI escape sequences problem
Bengt Werstén wrote:
> That did clear some part. The pseudo terminal concept was new for me although I have used it but without realizing how it actually worked. I still feel like some parts are a bit unclear. The main problem now is how do I disable all the IO buffering?
Well, it depends on what IO abstraction level you're using. There are
at least four that come to mind off the top of my head:
1. The Win32 API level, using HANDLES, e.g. ReadFile/WriteFile.
2. The C runtime level, using file descriptors, e.g. read/write.
3. The C runtime level, using C streams (FILE *), e.g. fread/fwrite.
4. The C++ runtime level, using iostream, e.g. cin/cout.
For (3) you can disable buffering with setvbuf() with _IONBF. For (4)
you can control buffering with foo.rdbuf()->pubsetbuf(0, 0), I think.
(1) and (2) are AFAIK direct in that they read or write as many bytes as
specified in the call without any buffering.
Brian
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users