Original Post
🔒 Locked
Start programs in Linux
Advertisement
you need to use the spawn fucntions. try looking at the man page for spawn.
Try ''man exec'':
You can use them with fork to avoid overwriting your current process. You can use ''system'' too, but I suggest that you don''t if you can avoid it.

NAME
execl, execlp, execle, execv, execvp - execute a file
SYNOPSIS
#include <unistd.h>
extern char **environ;
int execl(const char *path, const char *arg, ...);
int execlp(const char *file, const char *arg, ...);
int execle(const char *path, const char *arg , ..., char * const
envp[]);
int execv(const char *path, char *const argv[]);
int execvp(const char *file, char *const argv[]);
DESCRIPTION
The exec family of functions replaces the current process image with a
new process image. The functions described in this manual page are
front-ends for the function execve(2). (See the manual page for execve
for detailed information about the replacement of the current process.)
...
You can use them with fork to avoid overwriting your current process. You can use ''system'' too, but I suggest that you don''t if you can avoid it.

quote:
Original post by Zoot
"No manual entry for spawn"
yeah sorry about that, i just realised
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement