system( ) using cp
Posted on 2003-02-21
need help immediately for a c system call. I tried to copy one file from one directory to anther directory but did not workout. if do i this it will work:
system("cp /home/test/work/a.txt /home/test/ready/b.txt")
but if i do this it did not work, any hints ?:
#define PATH1 "/home/test/work/%s"
#define PATH2 "/home/test/ready/%s"
char file11, file2;
sprintf(file1, PATH1, "a.txt");
sprintf(file2, PATH2, "b.txt");
system("cp file1 file2");