Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
133 views

I want to check the file size ("compressed filesize") before closing the file .pclose() #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #...
0 votes
2 answers
75 views

I am writing a C++ program for an embedded Linux application for a custom device. Very often, I run Linux terminal commands via popen and pclose. If I need to only check whether the command was ...
0 votes
1 answer
117 views

I've tried all these commands: $cmd = "start /B php $rootPath\\$scriptName "; $cmd = "php $rootPath\\$scriptName > NUL 2>&1 &"; $cmd = "php $rootPath\\$...
Jayy's user avatar
  • 14.9k
1 vote
0 answers
191 views

I want to get the exit status of a pipe in C++, both on Linux and on Windows, to check whether a command ran successfully. On Linux (or POSIX more generally), it appears that the macros in <sys/...
RL-S's user avatar
  • 997
3 votes
1 answer
819 views

I am trying to get the exist status of the child process using popen(). Case 1: Calling function with the shell command returning error. This is working as expected. func("du -sh _invalid_file_&...
3 votes
1 answer
1k views

I'm writing a C++ daemon that is going to run on a Linux embedded system and execute a shell command. I'm trying to get both the output of the command (stdout) as well as the exit code of said shell ...
N0x's user avatar
  • 51
0 votes
0 answers
91 views

I'm seeing a strange issue. Sample code is included below When this code is run with valgrind, it complains that the memory allocated with popen is still reachable. Should i worry about this warning? ...
1 vote
1 answer
287 views

I recently wanted to get my hands dirty with understanding how to fork/exec a child process and redirecting stdin, stdout, and stderr thereof, by way of which I wrote my own popen() and pclose()-like ...
1 vote
0 answers
207 views

UPDATE 1: This question has been updated to eliminate the multithreading, simplifying its scope. The original problem popened in the main thread, and pclosed the child process in a different thread. ...
0 votes
0 answers
181 views

This question is pretty straightforward.... The pipe functions (popen, and pclose) and getdelim functions are not included in the Borland Turbo C Libraries I'm using. I'm unable to compile any code ...
sagar_02's user avatar
1 vote
1 answer
232 views

I try to get lost packets number (from ping command on raspberry) which I use for sim switching on router. I tried to do that with code at the bottom (reduced to error causing part), but when I try to ...
3 votes
4 answers
4k views

pclose()'s man page says: The pclose() function waits for the associated process to terminate and returns the exit status of the command as returned by wait4(2). I feel like this means if the ...
StoneThrow's user avatar
  • 6,455
0 votes
1 answer
2k views

This question is a follow up of this question : Controlling a C daemon from another program My goal is to control daemon process execution from another program. The daemon's code is really simple. ...
Arkaik's user avatar
  • 924
3 votes
1 answer
3k views

I am running MacOS and want to execute the "ps aux" command and get its output through my application. I have written a method which executes commands using popen function: std::string exec(const ...
MrWhite's user avatar
  • 199
1 vote
0 answers
160 views

this is my code: void Available_firmware_version(){ char *version = (char *) malloc(2); strcpy(version, ""); FILE *fp; int status = 0; char path[PATH_MAX]; fp = popen("swift list Manto", "r"); if (...

15 30 50 per page
1
2 3

AltStyle によって変換されたページ (->オリジナル) /