exec

Failure to start program from java (using ProcessBuilder)

I am trying to call cleartool from an java application, but cleartool hangs even for a simple "-version" argument. Running cleardiff instead of cleartool works fine, so apparently there is something specific with the cleartool program (which I assume is related to its interactive capabilities). The following program import java.io.*; i...

Any better alternative to fork() and then execvp(" gcc program.c ") ?

Hi, The following code segment takes more time (5s) when it is run first time and takes less time(250ms) on consecutive runs. Is there any better way to execute gcc. int pid,status; char * argv[] = {"gcc","program.c",NULL}; if(!(pid=fork())){ execvp("gcc",argv); } while(pid!=wait(&status)){ //do nothing } ...

Java exec on Unix

I have the Java code below running on Unix (both AIX and Linux), but it doesn't work. If I run this code the file q1.01 is not compressed, and I don't get any exceptions thrown (The file q1.01 exists, and I expect to find the file q1.01.Z after the command runs.) At the command prompt if I type "which compress" it reports back with "/usr...

webserver crash with exec in php

i am try to convert some file with exec in php and get the return . i do this and this is work so successfully but if i run it for more than 10 times, the webserver (wampserver) get crash and i must restart server to continue ? please let me know what is the problem if you know . System : wampserver version 2.0 on windows xp and 2003 se...

ANT Script handling Return value from exec

So this is the scenario. I have <target name="test"> <property file="blah"></property> <exec dir="" executable="trast.exe" resolveexecutable="true" spawn="true"> </exec> </target> <!-- So now I have the second target that uses Return value from first target --> <target name="test2"> <property file="blah"></property> <ex...

How do I run a process from PHP

I need to start a Unix process by calling a PHP-page through the web. I also need to send some arguments to the PHP-page that gets substituted into the command in a save way. ...

php exec and shell_exec not working

I want to run an exe file on my server and return the output to the browser screen. The exe file takes a input file and then returns data on the screen. Why is this code not working? $output = shell_exec('myprogram < INP.DAT'); echo "<pre>" . var_export($output, TRUE) ."</pre>\\n"; It displays "NULL" on the browser screen. I have als...

Validate signature on EXE with CertGetCertificateChain

I would like to verify a signed executable. The requirement is to validate that the executable itself is valid and where it came from (probably from the subject of the cert). The cert type is PKCS. I found a similar posting here, http://stackoverflow.com/questions/301024/validate-authenticode-signature-on-exe-c-without-capicom The Mi...

PHP exec() fails

I'm running wampserver and php5. exec() works when I run the script through the command-line, but when I try to run it through the server, it fails. I looked at all the error logs, there were none. I redirected stderr to stdout, there was still no output when I run it from the server. Any suggestions ? EDIT: I should have mentioned ...

How do I sudo environment?

I am using spamassassin in a php script, but when I train spamassassin as my user the php script's exec command to call spamassassin get the untrained version because of the user specific nature of sa-learn. So I need to sudo to my user in the exec command and get the environment of my user along with the premissions ...

Run a ffmpeg process in the background

I am wanting to use ffmpeg to convert video to .flv in php. Currently I have this working, but it hangs the browser until the file is uploaded and is finished. I have been looking at the php docs on how to run an exec() process in the background, while updating the process using the returned PID. Here is what I found: //Run linux com...

exec() not working as expected in PHP

Hi, I'm new to this forum. I have a PHP script in which I need to execute a shell script 'add_article.sh' which reads a parameter file and adds the news article contents to a search index (Lemur/Indri). Executing the 'add_article.sh' script on its own (from the shell) works perfectly, but running it from within the php script I get thi...

cURL failing when called from PHP exec()

I'm making a call to download an XML file and write it to a file using exec() and the curl command. I tried using curl_exec(), but it wasn't recognized by my PHP system. Somehow, the cURL call now fails. It didn't before, but one day I visit my site and– WHAM. Bye bye XML parser. Things that did work: Calling cURL from the command li...

sh command: exec 2>&1

What will this command do? exec 2>&1 ...

How can I execute a Perl script using the Ant exec task?

I currently have this in my Ant build script: <exec dir="${basedir}" executable="perl"> <arg line="${basedir}/version.pl -major"/> </exec> However, when that runs, I get this error message: [exec] Could not open -major [exec] Result: 2 To me, that says that what I have is trying to run a file called -major, which doesn't ...

Is it possible to make 'exec' use '$SHELL -c' instead of '/bin/sh -c' in Perl?

In Perl, is it possible to make 'exec', 'system', and 'qx' use a shell other than /bin/sh (without using a construct like 'exec "$SHELL -c ..."', and without recompiling perl)? EDIT: The motivation for this question is a bash script that does 'export -f foo' and then uses perl in a subshell to invoke the function directly via 'system "...

How to escape php exec() command with quotes

I use the Exiv2 command line tool on Linux to edit image metadata like so: exiv2 -M"set Iptc.Application2.Caption String This is my caption....." modify IMG.jpg I want to execute this from PHP, using a caption provide by a user. This will work if the user enters no special characters: exec('/usr/local/bin/exiv2 -M"set Iptc.Applicatio...

file flex air exec

i read this [link][1] thread . but currently i installed air 1.5.2 but cant be run fscommand() function is there any information? pls help me [1]: http://forums.adobe.com/thread/464862file flex air exec ...

flex C exec file

is there any way to execute C language executable file from Flex? ...

Storing dynamically generated code as string or as code object ?

I'm hacking a little template engine. I've a class (pompously named the template compiler) that produce a string of dynamically generated code. for instance : def dynamic_function(arg): #statement return rendered_template At rendering time, I call the built-in function exec against this code, with a custom globals dictionary (in ...