Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

explain_popen_or_die(3) [debian man page]

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)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

question about popen();

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)
Discussion started by: dell9
2 Replies

2. UNIX for Advanced & Expert Users

ftp application behaving erratically

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)
Discussion started by: diganta
7 Replies

3. Programming

popen and tar, please HELP!

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)
Discussion started by: stef83
4 Replies

4. Programming

Formatted piping popen() system call

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)
Discussion started by: toughguy2handle
1 Replies

5. Programming

how to use fifo

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)
Discussion started by: atticus
3 Replies

6. Programming

using popen with background process

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)
Discussion started by: matrixmadhan
7 Replies

7. Shell Programming and Scripting

explanation for this line

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)
Discussion started by: namishtiwari
3 Replies

8. Programming

C++ application halts at popen system call

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)
Discussion started by: Amiya Rath
6 Replies

9. UNIX for Advanced & Expert Users

How to know process is running or not?

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)
Discussion started by: Gopi Krishna P
7 Replies

10. Programming

gzip on pipe error handling

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)
Discussion started by: adm1n
4 Replies

11. Programming

popen hangs program during cmd execution

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)
Discussion started by: Jess83
5 Replies

12. UNIX for Dummies Questions & Answers

WHat are flags?

Can anybody actually tell, what is flag? I know they are termed as permission flags and various others. Please explain (3 Replies)
Discussion started by: nixhead
3 Replies

13. Programming

question about popen in C

does popen print out the executed string result in stdout, or just evaluate it and not print the result? (30 Replies)
Discussion started by: omega666
30 Replies

14. Programming

Shelling Out to Give a System Command Drains Free Memory

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)
Discussion started by: BrandonShw
5 Replies

15. Shell Programming and Scripting

Subprocess.popen() should write to log without waiting for process to complete

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)
Discussion started by: ezee
2 Replies