By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,305 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,305 IT Pros & Developers. It's quick & easy.

Save console buffers

P: n/a
Is it possible get to console state after some I/O has occured, like
printf's or system("command")?
Jul 4 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
In article <op.tb5qj5mvg2s0fy@doma-dnevni>, <iv**********@gmail.comwrote:
>Is it possible get to console state after some I/O has occured, like
printf's or system("command")?
The C standards don't have any idea what a "console" is,
so you are almost certainly asking in the wrong newsgroup.

When you locate a newsgroup more pertinent to your platform and
post your question there, you may wish to be more specific
about which aspects of the console state you wish to get.
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
Jul 4 '06 #2

P: n/a

iv**********@gmail.com wrote:
Is it possible get to console state after some I/O has occured, like
printf's or system("command")?
Standard C knows only about streams, not how they may be linked to
other I/O devices. The method to query details about the console will
differ from system to system. You'd get a better response if you post
to a group that deals with your system, say comp.os.ms-windows.* or
comp.os.linux etc.

Jul 4 '06 #3

P: n/a
iv**********@gmail.com wrote:
Is it possible get to console state after some I/O has occured, like
printf's or system("command")?
Not in standard C. If you want to do that then you will need a system
specific answer. However, depending on what your problem really is,
there might be an even better system specific answer. So I suggest you
ask in a group dedicated to your system and when asking explain exactly
what problem you are trying to solve.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Jul 4 '06 #4

P: n/a
In article <op.tb5qj5mvg2s0fy@doma-dnevni>, <iv**********@gmail.com>
wrote:
>Is it possible get to console state after some I/O has occured, like
printf's or system("command")?

The C standards don't have any idea what a "console" is,
so you are almost certainly asking in the wrong newsgroup.

When you locate a newsgroup more pertinent to your platform and
post your question there, you may wish to be more specific
about which aspects of the console state you wish to get.

But there isn't a group related to stdio.h, where am i supposed to ask a
question such as this?
Jul 4 '06 #5

P: n/a
iv**********@gmail.com wrote:
In article <op.tb5qj5mvg2s0fy@doma-dnevni>, <iv**********@gmail.com>
wrote:
Is it possible get to console state after some I/O has occured, like
printf's or system("command")?
The C standards don't have any idea what a "console" is,
so you are almost certainly asking in the wrong newsgroup.

When you locate a newsgroup more pertinent to your platform and
post your question there, you may wish to be more specific
about which aspects of the console state you wish to get.

But there isn't a group related to stdio.h, where am i supposed to ask a
question such as this?
As has been mentioned already, Standard C has no definition of
"consoles". It is an operating system feature and naturally, details of
manipulating it will vary from system to system. C only provides the
abstract concept of streams including three predefined ones, stdin,
stdout and stderr. They may or may not be connected to "consoles",
depending on your specific setup and how the program is invoked. Even
if they were, they provide no way to access the "state" of the
"console" or any other details.

You'll have to use system specific functions. For Windows start at the
following URL:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/character_mode_applications.asp>

For Linux:
<http://www.gnu.org/software/libc/manual/html_node/Low_002dLevel-Terminal-Interface.html#Low_002dLevel-Terminal-Interface>

For more details ask in a system specific group.

Jul 4 '06 #6

P: n/a
iv**********@gmail.com writes:
>In article <op.tb5qj5mvg2s0fy@doma-dnevni>,
<iv**********@gmail.com wrote:
>>Is it possible get to console state after some I/O has occured, like
printf's or system("command")?

The C standards don't have any idea what a "console" is,
so you are almost certainly asking in the wrong newsgroup.

When you locate a newsgroup more pertinent to your platform and
post your question there, you may wish to be more specific
about which aspects of the console state you wish to get.

But there isn't a group related to stdio.h, where am i supposed to ask
a question such as this?
Yes, there is a group that covers stdio.h; this is it. The problem is
that stdio.h doesn't provide any facility to do what you want. You
should ask in a newsgroup that's specific to your operating system,
and you should be more clear when you ask your question there.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 4 '06 #7

P: n/a
On Tue, 04 Jul 2006 12:32:48 +0200, in comp.lang.c ,
iv**********@gmail.com wrote:
>In article <op.tb5qj5mvg2s0fy@doma-dnevni>, <iv**********@gmail.com>
wrote:
>>Is it possible get to console state after some I/O has occured, like
printf's or system("command")?

The C standards don't have any idea what a "console" is,
so you are almost certainly asking in the wrong newsgroup.

When you locate a newsgroup more pertinent to your platform and
post your question there, you may wish to be more specific
about which aspects of the console state you wish to get.


But there isn't a group related to stdio.h,
There is (this one) but your question doesn't relate to stdio.h.

C is designed to be independent of how each platform (Windows, Linux,
IBM mainframe, casio pocket calculator etc) handles IO. The stdio
interface hides all the 'mess' from the user.

Consequently, with plain C you can't get at the details of the
console, or GUI, or LCD panel or whatever. You need extension
libraries specific to your hardware and operating system to do that.
Luckily, most compilers will come with some.
>where am i supposed to ask a question such as this?
You need to ask in a newsgroup specialising in the OS and/or the
compiler. You should also read your compiler documentation (though
that may be hard to understand...)

You mention "command" which makes me suspect windows, so one of the
mswindows programming groups might be appropriate.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 4 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.