explain_popen_or_die(3) Library Functions Manual explain_popen_or_die(3)NAME
explain_popen_or_die - process I/O and report errors
SYNOPSIS
#include <libexplain/popen.h>
FILE *explain_popen_or_die(const char *command, const char *flags);
DESCRIPTION
The explain_popen_or_die function is used to call the popen(3) system call. On failure an explanation will be printed to stderr, obtained
from explain_popen(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
FILE *fp = explain_popen_or_die(command, flags);
command The command, exactly as to be passed to the popen(3) system call.
flags The flags, exactly as to be passed to the popen(3) system call.
Returns:
This function only returns on success, see popen(3) for more information. On failure, prints an explanation and exits.
SEE ALSO popen(3)
process I/O
explain_popen(3)
explain popen(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_popen_or_die(3)
Check Out this Related Man Page
explain_fputc_or_die(3) Library Functions Manual explain_fputc_or_die(3)NAME
explain_fputc_or_die - output of characters and report errors
SYNOPSIS
#include <libexplain/fputc.h>
void explain_fputc_or_die(int c, FILE *fp);
DESCRIPTION
The explain_fputc_or_die function is used to call the fputc(3) system call. On failure an explanation will be printed to stderr, obtained
from explain_fputc(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_fputc_or_die(c, fp);
c The c, exactly as to be passed to the fputc(3) system call.
fp The fp, exactly as to be passed to the fputc(3) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO fputc(3)
output of characters
explain_fputc(3)
explain fputc(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_fputc_or_die(3)
Hi
The following is my program to test popen()
routine. The purpose is to print some contents
of the corrent directory.
But in fact, the output is only one character
'a', which I believe is the first char of the file
"a.out".
So, can anybody tell me what is wrong about
this program?... (2 Replies)
Hi,
I am working on a custom made FTP application. The application is behaving erratically for the "ls" command. Wild card character passed to the "ls" command (like "ls *temp") is giving inconsistent results. On debuggin I have found that the "ls" command is implemented as shown below in the... (7 Replies)
Hi there,
I'm facing a problem running the tar command with the popen function.
FILE* fp = popen("tar czf - textfile","r")
// output
this program should give the output to the stdout. I don't know if it is possible and which function like fprint() etc. should I use.
I suppose that I... (4 Replies)
Facingproblem in writing a c code that sorts a given string using piping popen() system call..
the question reads
write a c program inclusive of all error conditions that sorts the given string of arrays as{"bravo","sit","class"}using formatted piping popen() system call (1 Reply)
hi, I have a problem. I've done a lil program which gets from the server the given persons username a personal folder. I made it with a pipe calling popen with a command, but how can i make the same thing using fifo. I make the fifo with mkfifo() func. and than what. How do I tell the sertver using... (3 Replies)
hi,
how to work with a background process without a controlling terminal to make use of popen or system call ?
when ever i use popen or system function call in foreground process, there is no problem with respect to that .. but when the same program is run as a background process without a... (7 Replies)
Hi All,
can you please explain me the meaning of this line--
BackupLocation="/inpass/abc"
Parent=$(expr $BackupLocation : '\(.*\)/.*' \| $BackupLocation)
when i ran this as a command also it did not show me anything so could not get the purpose of this line.
Explain it please. (3 Replies)
Hi All,
My application gets hang at the popen statement in Soalris 5.8. While debugging I found that it halts at _lwp_sema_wait. After googling I have added /usr/lib/lwp in the LD_LIBRARY_PATH and now it halts at lwp_park. Please help me what I need to do to solve this issue. The application runs... (6 Replies)
please suggest me a way to write c program that takes pattern of the process and returns true or false
my case is i need to keep track of dhcpcd
dhcpcd -d eth1
so i tried popen("ps -ef | grep dhcpcd | grep eth1 | wc -l", "r");
but pipe is storing 1 or 2 when not running
and 2 or 3... (7 Replies)
Hi all...
I have the following code:
FILE *fp = popen(" gzip -dc /somemount/somefile.gz", "r");
while(fgets(buffer, 1024, fp))
{
some code....
}
"/somemount" is a mount of some network drive. Sometimes error occurs in while loop - I can see the following "Input/Output error"... (4 Replies)
How can I get around this? when my program reaches the following popen job it halts the program until the ping/netstat/ipconfig/traceroute is completed then resume to the rest of the program...
FILE *in;
extern FILE *popen();
char buff;
char newline;
char nstat;
char nping;
... (5 Replies)
I am working on a large program which is always up and must run in as many Linux flavors as possible, i.e. be portable. I have created a number of general utility functions for common tasks it needs to do, and one of these utility functions goes out to the shell to give a Linux command and return... (5 Replies)
Here is my test code
process = sp.Popen( + ,
bufsize=1,
universal_newlines=True,
stdout=sp.PIPE, stderr=sp.STDOUT,
cwd=src_home)
output, _ =... (2 Replies)