Changeset 2472

Show
Ignore:
Timestamp:
01/23/07 17:43:01 (2 years ago)
Author:
dhozac
Message:

Don't overwrite files that already exist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vclone.c

    r2467 r2472  
    133133 
    134134    PathInfo_append(&dst_path, &src_path, dst_path_buf); 
    135     if (S_ISREG(f_stat.st_mode) && Unify_isIUnlinkable(src_d_path.d) == unifyBUSY) { 
     135 
     136    /* skip files that already exist */ 
     137    if (access(dst_path.d, F_OK)!=-1) 
     138      res = 0; 
     139    else if (S_ISREG(f_stat.st_mode) && Unify_isIUnlinkable(src_d_path.d) == unifyBUSY) { 
    136140      Elink(src_d_path.d, dst_path.d); 
    137141      res = 0; 
     
    142146        exit(wrapper_exit_code); 
    143147      } 
    144       if (S_ISDIR(f_stat.st_mode)) 
    145         res = visitDir(dirname, &f_stat); 
    146       else 
    147         res = 0; 
     148      res = 0; 
    148149    } 
     150    if (S_ISDIR(f_stat.st_mode)) 
     151      res = visitDir(dirname, &f_stat); 
    149152  } 
    150153