rem: sprintf(buffer, "/bin/cp %s %s", file, dir);
add: sprintf(buffer, "/bin/cp \"%s\" \"%s\"", file, dir);
context: copyFile(char *dir, char *file){    char buffer[4000];        sprintf(buffer, "/bin/cp %s %s", file, dir);    if (system(buffer)!=0) {	printf("%s: could not copy file %s\n", ProgName, file);    }}