5,940 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
120
views
Writing and executing a file from within the Linux kernel
I need to write (modify) an executable file and then execute it from a Linux system call. I have attempted to create (open) the file, write to it, close it, and then execute it. The problem is that ...
0
votes
1
answer
115
views
String created for 'exec' works on command line, but not in 'exec'
I try to write sort of a 'file watcher' that regularly processes all new files in a directory since last run. I started it with the use of CoPilot and it comes up with the very handy dos-command '...
0
votes
0
answers
18
views
adding an extended property in another database
I'm designing a general backup usp and one the features is to add an extended property to the database that is going to be backup-ed. The code I'm trying is
declare @my_sql nvarchar(4000) = 'HPAdmin....
-1
votes
1
answer
130
views
php script stops right after calling php exec() function
<?php
$output = [];
$fd=try_lock($file); // which basically applies a lock using flock() with LOCK_EX and LOCK_NB flags
if (is_null($crl_lock)) {
$input_errors[] = gettext("A CRL update is ...
0
votes
1
answer
190
views
Java Process.waitFor() does not wait
I am following a book on Java 'Java: The Complete Reference, 11th Edition" which has the following code
class ExecDemoFini {
public static void main(String args[]) {
Runtime r = ...
0
votes
2
answers
75
views
tcl: pause script until file (opened with exec) is edited
I have a script running on windows that use this command:
exec notepad file.txt
it will pause the script until I close the file.txt notepad tab, it allows me to edit the file before letting the ...
0
votes
2
answers
60
views
PHP exec() - unzip large file - how to check if the process is finished?
I use exec() function to unzip large file (when I tried using ZipArchive, I got an error with max execution time). Here is my code:
exec('unzip '.$path.'exports/'.$dir.'/'.$file.' -d '.$path.'exports/'...
0
votes
0
answers
70
views
nodejs child_process exec set encoding
I am running a virussoftware scan via command line and the output will list me some informations in german that has umlaute (ö, ä, ü). The command is something like "C:\Program Files\Antivirus\...
1
vote
2
answers
104
views
PHP: posix_seteuid() and posix_setuid() not reflected in exec() or proc_open()?
When using exec() or proc_open() after posix_seteuid() or posix_setuid() I expected the resulting process to run as the UID I set inside the running script. This does not happen.
is this how it's ...
2
votes
1
answer
125
views
Perl on Windows not executing MD command in back-ticks
I found Perl installed on my PC:
C:\Users\matth>perl -v
This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-msys-thread-multi
[...]
It came in with installing Git. I never did ...
1
vote
1
answer
77
views
Golang exec command docker-compose
I have a Linux operating system (Ubuntu).
I want to run docker-compose on command from the frontend. For this I wrote a service that has access to the docker-compose.yml file. .env file is located in ...
0
votes
1
answer
65
views
Exec in Python not capturing output
exec("a=1\nprint(a)") prints 1, as expected. However exec("a=1\na") does not print out 1. Why is that?
I expect it to print out 1 because in the Python interpreter, whenever I ...
1
vote
1
answer
66
views
Python: trying to use exec(), pathlib and __file__ in combination fails
I'm trying to use the __file__ variable within a Class with exec() and pathlib in Python 3.11.2
...which I haven't managed to do so far. The response to my attempts has always been None or an error ...
-1
votes
1
answer
277
views
How to mock promisified child process exec with Jest
I'm trying to write a test for this piece of code:
const util = require('node:util')
const exec = util.promisify(require('node:child_process').exec)
class Command {
async execute(command) {
try ...
0
votes
0
answers
43
views
Java Runtime.getRuntime().exec is frozen and only continues running when the starting program is closed [duplicate]
I have a problem with a Java application (program1) starting another Java application (program2).
If program2.jar has to process a large amount of data, the program2 freezes and only continues running ...