Bookmarked that one too, thanks.
Edit:
Another problem in my project has come up (related to the previous one, that's why I'm not creating a new thread). I got strcat() to work, and I'm using:
Code:
// added the / in the filename to make it work
strcat(¤tDir, fileName);
[...]
// the using the variable in an array
char *argv1[] = {"touch", "input_file.txt", NULL};
char *argv2[] = {"cat", setPath, ">>", ¤tDir, NULL};
[...]
// using the arrays in the child process
execve("/usr/bin/touch", argv1, NULL);
execve("/bin/cat", argv2, NULL);
The problem is my file, 'input_file.txt' is empty. My guess is that the second array is failing, but how can I make the '>>' to work?