I have installed mingw in my system to be able to compile c++ programs using terminal. I am creating a NodeJs api which when called with the C++ code and input compiled and generates output. For this I am using child_process of NodeJS. Now on terminal, when I open "./a.exe", I need to feed input ..
Category : child-process
I have a Node.js program where I need to, on a button click, run 2 commands in the Windows command line. For example, the process I’m trying to automate by the button click would be doable manually by going to cmd and entering the following commands: pushd myserver.comfolder1folder2 //Connect to remote server folder structure mkdir ..
So I can’t seem to get variables to work with Node exec commands on Windows. Code: exec(‘SET "NUM=42" && echo %NUM%’, (err, stdout, stderr) => { // other checks for errs console.log(stdout); }); But my output is %NUM%. Running this command using cmd.exe results in 42. I checked that %COMSPEC% is referring to come.exe and ..
I’ve been working on this school assignment forever now, and I’m super close to finishing. The assignment is to create a bash shell in C, which sounds basic enough, but it has to support piping, IO redirect, and flags within the piped commands. I have it all working except for one thing; the | piping ..
I’m trying to run FFMPEG as a child process on NodeJS to extract a snapshot of an mp4 video on Windows. But even spawning the process with the "silent" option, it stills opening the command prompt for a short period. Any idea of what might be happening? The code looks something like this: const snapshot ..
Why is GDB not able to see my local variable i ? I am debugging a multi-process application running on an embedded linux device. I am having a hard time attaching to a child process (note that I cannot start the child process by itself, it needs the parent to run it. ) Using set ..
I have a global npm package that I want to spawn as a process from a NodeJS application. The problem is that on Windows 10 I have to use the property shell: true, otherwise I will receive the following error as mentioned here Error: spawn pm2 ENOENT The problem is that I don’t want to ..
I have a C++ web service that, on user demand via REST API, launches a process that may run for minutes. I need to detect when that process terminates, so I can conditionally launch it again. My first approach was to launch it as a boost::process::child, save its child object in a list, and in ..
I have a simple node index.js file that uses an event emitter to emit data every two seconds. Within this file I export the reference of the event emitter as I wish to use it in another file user.js. When I run the index.js everything works as expected. Then when I open another ternimal and ..
I’m writing a Node script that performs a "Reveal file in explorer" function. My code boils down to this: const {spawn} = require(‘child_process’); // This works (it opens C:/path/to/file and highlights the file named "WithoutSpaces" spawn(‘explorer’, ["C:pathtofileWithoutSpaces,", "/select"]); // However, this does not work. It defaults to opening a file explorer window with my Documents ..
Recent Comments