Questions tagged [os.execl]
33 questions
1
vote
2 answers
C program that makes use of the system calls for creating processes
I want to make a C program that makes use of the system calls for creating
processes. The program should receive from the command line an undetermined number
of Linux commands to execute them in parallel or in sequence according to the option…

Devoid
- 11
- 1
- 3
1
vote
1 answer
Cannot open file properly in VLC with Python's os.execv or os.execl on Windows
I am working on a script that opens media files in VLC Media Player with one of the os.exec* methods. I am using Python v3.6 on Windows 10.
VLC opens with an error stating that the file cannot be opened, however, the path to the file is also wrong.…

Jesse
- 69
- 1
- 7
1
vote
1 answer
How to use os.execve in Python
I just started learning Python today and couldn't find a good example online to help me understand os.execve(path, args, env) properly.
How do I use this method (os.execve) to achieve the following task in Python 3.4?
Execute an external command…

Dhiwakar Ravikumar
- 1,983
- 2
- 21
- 36
1
vote
3 answers
waitpid with execl used in child returns -1 with ECHILD?
When do I need to use waitpid if I am using execl in a child process which may take time to finish?
When I use waitpid in the parent, it tells me that the child is running as the return value from waitpid is 0. However, if I call waitpid after some…

kapilddit
- 1,729
- 4
- 26
- 51
1
vote
2 answers
How to create a file using execl command in c
#include
#include
#include
#define MAXLINIE 100
main(int argc, char* argv[]) {
if (fork()==0){
execl("/bin/> temporar.txt", "/bin/> temporar.txt", ">temporar.txt", NULL);
}
}
Basically, what I am…

JackRobinson
- 225
- 2
- 11
- 24
0
votes
1 answer
ModuleNotFoundError: No module named 'module name' on os.execv call - python
I am trying to execute the same program with different arguments by calling :
os.execv(sys.executable, ['python'] + [abs_file_path] + [str(new_arg)])
but when I do that and I get to this line, it attempts to run the file but I get…

giulio di zio
- 171
- 1
- 11
0
votes
0 answers
Python EOFError after using os.execl to restart the script
I have a script that does the following;
Checks if a temp.txt file is present in the working directory.
If present the temp.txt file and update.pyd file is removed.
Checks whether an update.pyd module is present in the working directory.
If…

I_do_python
- 1,366
- 4
- 16
- 31
0
votes
3 answers
Running "source" from python
I have a file a.txt with lines of commands I want to run, say:
echo 1
echo 2
echo 3
If I was on csh (unix), I would have done source a.txt and it would run.
From python I want to run os.execl with it, however I get:
>>> os.execl("source",…

R S
- 11,359
- 10
- 43
- 50
0
votes
1 answer
Missing columns while importing excel data into SQL Server 2012
I am moving Excel data into SQL Server 2012 using the Import/Export wizard.
The Excel sheet has 377 columns, but when I am importing the file into SQL Server, only 255 columns are appearing in the table. Where are the rest of the columns?

Himanshu Tomar
- 3
- 1
- 2
0
votes
1 answer
How to open new terminal, execl
Are there any ways to open new terminal using execl() or execlp. Smt like gnome-terminal -x?
Already tried it before path, doesn't work. If not, mb it is possible to open new terminal when process starts running?

Max
- 3
- 2
0
votes
1 answer
Can't use execl to list a specific directory
I am making a C program that lists files using execl to execute the ls command. If the program is called without any command line arguments, the current directory is listed and if the user specifies a file directory as a command line argument then…

user3708934
- 9
- 2
0
votes
2 answers
how to use execl corrrectly?
I was trying to redirect the output from an arduino ( USB ) to some file at the computer using the next code:
#include
#include
#include
int main()
{
pid_t pid;
pid = fork();
if (pid == 0) {
…

mrmurmanks
- 33
- 12
0
votes
1 answer
Exporting Datatable to Excel gives Exception from HRESULT: 0x800A03EC part way through
I'm trying to export a DataTable to Excel 2007. When I get to the Excel.Range line i partially exports the Array I created but then gives me an error (System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC). …

Tyddlywink
- 876
- 7
- 28
0
votes
2 answers
Switching from Python 3 to 2 in a runtime
I try to check if current version is 3 and if so, switch to python2:
#!/usr/bin/python
import sys, os
if sys.version_info[0] != 2:
os.execl("/usr/bin/", "python2", *sys.argv)
print(sys.version_info[:])
But this script returns this…

ciembor
- 7,189
- 13
- 59
- 100
0
votes
2 answers
Using grep with execl ,it starts an infinite loop?
I'm doing a small c program for testing some Unix commands.
I provide the user with choices he can test and then allows him to enter his choice. If the user enters the number 2 as his choice ,the following code should run which is testing the grep…

Ghadeer Walid
- 41
- 3
- 10