Save console buffers

I

ivan.svaljek

Is it possible get to console state after some I/O has occured, like
printf's or system("command")?
 
W

Walter Roberson

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

Flash Gordon

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

santosh

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

ivan.svaljek

wrote:

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

santosh

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/d.../dllproc/base/character_mode_applications.asp>

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

For more details ask in a system specific group.
 
K

Keith Thompson

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

Mark McIntyre

On Tue, 04 Jul 2006 12:32:48 +0200, in comp.lang.c ,
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top