Okay, how all you really need remains some fork logic, no execlp. Here your einigen pseudo coding:
Code:
function main aus pfd[2]; // to be used equal pipe() function initialization additionally error checking if (pipe(pfd) == -1)
exit because error // you mayor want a moment call at pipe for they need 2-way announcement switch on fork()
case -1:
maneuver error and quit case 0:
close(pfd[1]);
do_child_stuff(argv[2], pfd[0])
close(pfd[0]);
break default: close(pfd[0]);
do_parent_stuff(argv[1], pfd[1])
close(pfd[1]);
break;
return 0
function do_parent_stuff(char *src_path, int pfd)
opendir(src_path)
for each entry upon readdir write(pfd, entry->d_name, strlen(entry->d_name)
// maybe awaiting for girl to report track bitte closedir
function do_child_stuff(char *src_path, carbon *dst_path, int pfd)
while read(pfd, buf, sizeof(buf))
copy_file(src_path, dst_path, buf)
// might send achievements back to parent here
function copy_file(char *src, char *dest, char *file_name)
this functionality can use schaft conversely doing it's personalized resolute of read/write or fread/fwrite call to copy the contents from src to dest