How do I get system answer in c


 
Thread Tools Search this Thread
Top Forums Programming How do I get system answer in c
# 8  
Old 05-14-2008
Actually the problem is that you are getting those messages on standard error, not standard output. Try popen3 if your system has that.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

==please answer the following questions==

Hello :) ! i've few doubts. 1) how can we find the newly attached disk in SOLARIS ? 2) how to change port number of a service ? 3) how can we find that autofs is running in our system without using svcs and prstat commands ? 4) we know that there are several types of dns servers in... (0 Replies)
Discussion started by: vamshigvk475
0 Replies

2. UNIX for Dummies Questions & Answers

I welcome all to answer my Q's

Hi everyone,, I am new to the forum...but not to Unix. I have gathered few questions from my mates who attended interviews in various companies as I have to attend one on dec 3rd for Sys admin position. Please respond with the answers you know and also help with various other interview... (2 Replies)
Discussion started by: impawan
2 Replies

3. Shell Programming and Scripting

help me to answer this

Hello everyone I update my question. Thanks for your reply joeyg If I type the last command and send to a text file. I get this last >usuarios.txt root pts/0 160.40.35.277 May 22 11:08 still logged in. root pts/0 alopez02 May 22 09:23 - 10:11 (00:47) root pts/0 160.40.35.277 May 20... (0 Replies)
Discussion started by: lo-lp-kl
0 Replies

4. UNIX for Dummies Questions & Answers

Answer them if u can...

Try to answer these questions on Unix: 1.what will be the segment() function do? 2.How Unix is more powerful than Windows? 3.Where ownership details will be stored of a particular file in Unix? 4.State different uses of ^ symbol in regular expressions. 5.What does export command used for?... (5 Replies)
Discussion started by: dreambig
5 Replies

5. UNIX for Dummies Questions & Answers

quick answer

i know by posting this people are going to get mad at me but, when i try to download unix for my Windows XP i find a whole bunch of files that i dont know what to do with, so please help, sorry if this has already been posted... or is a stupid question :o (9 Replies)
Discussion started by: DarkestEvil
9 Replies

6. Solaris

Can anybody answer this.....

Hi i am trying the threads concept in unix environment using C... but i am getting error of "wait_fd: Couldn't find procinfo for fd 24"... what does this error mean..... help me in solving this issue... Thanks in advance shivamasam (3 Replies)
Discussion started by: shivamasam
3 Replies

7. Programming

can any one answer ????

Q.1 Diffrence between terminal and pseudo-terminal ? Q.2 What is terminal login ? What is a netwok Login ? Q.3 What is meant by baud rate of a terminal ? Q.4 which structure is used for job control in Unix/Linux ?and where these structure are means in which directory ? (2 Replies)
Discussion started by: mobile01
2 Replies

8. UNIX for Dummies Questions & Answers

urgent answer these please

Hi, Please explain what does '$*' mean. what does the command cd /~abc do, especially what does '~' mean? cheers. (1 Reply)
Discussion started by: uni_ajay_r
1 Replies

9. Programming

get system() answer ?

Hi , how can i get the system reply from a system() command ? is it possible to evaluate the return of a system command ? (4 Replies)
Discussion started by: Sven28
4 Replies
Login or Register to Ask a Question
RRDp(3) 						User Contributed Perl Documentation						   RRDp(3)

NAME
RRDp - Attach RRDtool from within a perl script via a set of pipes; SYNOPSIS
use RRDp RRDp::start path to RRDtool executable RRDp::cmd rrdtool commandline $answer = RRD::read $status = RRD::end $RRDp::user, $RRDp::sys, $RRDp::real, $RRDp::error_mode, $RRDp::error DESCRIPTION
With this module you can safely communicate with the RRDtool. After every RRDp::cmd you have to issue an RRDp::read command to get RRDtools answer to your command. The answer is returned as a pointer, in order to speed things up. If the last command did not return any data, RRDp::read will return an undefined variable. If you import the PERFORMANCE variables into your namespace, you can access RRDtool's internal performance measurements. use RRDp Load the RRDp::pipe module. RRDp::start path to RRDtool executable start RRDtool. The argument must be the path to the RRDtool executable RRDp::cmd rrdtool commandline pass commands on to RRDtool. Check the RRDtool documentation for more info on the RRDtool commands. Note: Due to design limitations, RRDp::cmd does not support the "graph -" command - use "graphv -" instead. $answer = RRDp::read read RRDtool's response to your command. Note that the $answer variable will only contain a pointer to the returned data. The reason for this is, that RRDtool can potentially return quite excessive amounts of data and we don't want to copy this around in memory. So when you want to access the contents of $answer you have to use $$answer which dereferences the variable. $status = RRDp::end terminates RRDtool and returns RRDtool's status ... $RRDp::user, $RRDp::sys, $RRDp::real these variables will contain totals of the user time, system time and real time as seen by RRDtool. User time is the time RRDtool is running, System time is the time spend in system calls and real time is the total time RRDtool has been running. The difference between user + system and real is the time spent waiting for things like the hard disk and new input from the Perl script. $RRDp::error_mode and $RRDp::error If you set the variable $RRDp::error_mode to the value 'catch' before you run RRDp::read a potential ERROR message will not cause the program to abort but will be returned in this variable. If no error occurs the variable will be empty. $RRDp::error_mode = 'catch'; RRDp::cmd qw(info file.rrd); print $RRDp::error if $RRDp::error; EXAMPLE
use RRDp; RRDp::start "/usr/local/bin/rrdtool"; RRDp::cmd qw(create demo.rrd --step 100 DS:in:GAUGE:100:U:U RRA:AVERAGE:0.5:1:10); $answer = RRDp::read; print $$answer; ($usertime,$systemtime,$realtime) = ($RRDp::user,$RRDp::sys,$RRDp::real); SEE ALSO
For more information on how to use RRDtool, check the manpages. AUTHOR
Tobias Oetiker <tobi@oetiker.ch> perl v5.16.3 2014-06-10 RRDp(3)