Skip to content
Advertisement

Tag: popen

how to interpret pclose() status when popen() fails?

My application running on embedded linux (busybox) tries to execute a script via popen(cmd, “r”). cmd = “sh /tmp/DF1_05/update.sh DF1_05” I can execute this script without problem launching it by hand from sh, but it fails when it’s launched by the application. The first lines of update.sh script are: I cannot even see the echo ouput. My application’s code is:

Wait for popen script to terminate in C

Is that possible with C to wait until the popen subprocess is finished? I have a script launched by a C daemon which will connect to a wifi network when an external signal is triggered. Here is my code for now : However, I’m not waiting for the subprocess to finish so when I’m closing the pipe, the ressource is

Sending an arrow key with fprintf

I’m testing out pipes and have hit a little road block. I want to be able to simulate pressing the right arrow key through a file pointer opened by popen. The file pointer opens a display program on a different terminal, much like a projector. I would like to send a signal to advance the next image (the right arrow

popen (“tar xvf tarball.tar”) works in debug but not release builds

I’m working on a C++ program for Ubuntu that downloads a tar archive using curl_easy_perform, and after the archive is downloaded into /tmp I use popen to execute the appropriate tar command line. When I run my program’s debug build then popen(“tar xvf /tmp/example.tar -C /tmp/existingdir”) works, but when I run this command in release builds the popen call always

Advertisement