I've got a utility that outputs a list of files required by a game. How can I run that utility within a C program and grab its output so I can act on it within the same program?
UPDATE: Good call on the lack of information. The utility spits out a series of strings, and this is supposed to be complete portable across Mac/Windows/Linux...
I have C# winforms application that needs to start an external exe from time to time, but I do not wish to start another process if one is already running, but rather switch to it.
So how in C# would I so this in the example below?
using System.Diagnostics;
...
Process foo = new Process();
foo.StartInfo.FileName = @"C:\bar\foo.exe";...
Hi,
I am executing a diff command in perl.
my @lines = `/usr/local/bin/diff -udr \"$expected_file\" \"$gen_file\"`;
if ($? != 0)
{
print ERRFILE "Diff between $expected_file and $gen_file failed\n";
return $diff_err;
}
Here the diff might have failed because of some reason. For example: the stderr showed that /usr/local/bin/...
What I need to do is have a C# 2005 GUI app call a .bat and several VBScript files at user's request. This is just a stop-gap solution until the end of the holidays and I can write it all in C#. I can get the VBScript files to execute with no problem but I am unable to execute the .bat file. When I "click" in the C# app to execute the .b...
Has anyone seen this error when trying to call an external C function from an Oracle query? I'm using Oracle 10g and get this error every time I try to call one of the two functions in the library. A call to the other function returns fine every time, though the function that works is all self-contained, no calls to any OCI* functions....
I have this program in c++:
#include <iostream>
using namespace std;
int main()
{
char buf[50];
cin.getline(buf,49);
system(buf);
return 0;
}
When I run and compile it and type for example "helo", my program prints the error:
"helo" not found.
Can I stop this error from being displayed? Is there any way to disable the error from...
Hi
I have a set of .EXE commands. How do I get all those commands run in Perl as a single file?
Whats the process to call the .EXE files in Perl?
...
I'm creating a win service that monitors ftp logs, when a file has been uploaded I want to start an external application, like a powershell script, to do stuff with the file. my Question is do i want to spin this off into another thread when i do it or should I just wait until it finishes before moving on.
This process is already goin...
Hi,
How can I call an external program with a python script and retrieve the output and return code?
...
Hi all,
What is the simplest way to call a program from with a piece of Java code? (The program I want to run is aiSee and it can be run from command line or from Windows GUI; and I am on Vista but the code will also be run on Linux systems).
...
I am working on a program written in Java which, for some actions, launches external programs using user-configured command lines. Currently it uses Runtime.exec() and does not retain the Process reference (the launched programs are either a text editor or archive utility, so no need for the system in/out/err streams).
There is a minor...
Not to long ago i asked about an error msg that occurred when when app.PriorityClass = ? was before app.start. Apparently the solution which i didnt like was to write it after start.
It worked without much problem until today. I get a "Cannot process request because the process has exited." exception because the process completes quickl...
I am spawning external console application and use async output redirect.
as shown in this SO post
My problem is it seems that the spawned process needs to produce certain amount of output before I get the OutputDataReceived event notification.
I want to receive the OutputDataReceived event as soon as possible.
I have a bare-bones...
echo system("/usr/bin/whoami", $ret);
echo $ret;
PHP 4.3.9 on Apache 2.0.52, CentOS 4.5. Safe mode is off, I can run programs as the apache user account from the command line, but all programs run from PHP fail with exit code 127.
...
I have a WPF app which contains a number of child controls.
One of these controls hosts a third party library which underneath the covers runs some native code which throws access violations and crashes the application. Unfortunately removing the library is not an option.
What I'd like to do is spin up a new windows process, host the t...
I have a Windows service which I want to periodically execute an external program. I'm currently doing this the usual way
Process program = Process.Start(@"C:\mpewatch\db_parameters\DBParameters.exe");
This doesn't seem to be working. I'm executing this from a separate thread which is started in my service's OnStart handler. Is the...
I have a command line executable that is run from a C# class library. In some very rare situations the executable will hang because of the command line data passed to it. Unfortunetely this causes the application calling the c# DLL to hang whilst it waits indefinitely for the process to exit.
If the command line exe doesnt finish execut...
How can I invoke an external shell script (Or alternatively an external PHP script) from PHP itself and get its process ID within the same script?
...
Possible Duplicate:
subprocess with timeout
What is the easiest way to do the following in Python:
Run an external process
Capture stdout in a string, stderr, and exit status
Set a timeout.
I would like something like this:
import proc
try:
status, stdout, stderr = proc.run(["ls", "-l"], timeout=10)
except proc.Timeout...
I tried these two methods:
os.system("python test.py")
subprocess.Popen("python test.py", shell=True)
Both approaches need to wait until test.py finishes which blocks main process. I know "nohup" can do the job. Is there a Python way to launch test.py or any other shell scripts and leave it running in background?
Suppose test.py is ...