Next Program Repair Shop 90

Repeated Tests

    34         if (-d $src_file) {
    35           if (! -d $dst_file && -e $dst_file ) {
    36             die "Can't mkdir $dst_file because a same name file exist\n";
    37           } elsif ( ! -e $dst_file ) {
    38             print "mkdir  $dst_file\n";
    39             mkdir $dst_file or die "Couldn't create dir : $dst_file\n";
    40           }
    23       if (! -d $target_directory && -e $target_directory) {
    24         die "Can't continue because a file has target's dir name\n";
    25       } elsif ( ! -e $target_directory ) {
    26         mkdir $target_directory || die "Couldn't create dir : $target_node\n";
    27       }
     if (-d $src_file) {
       xcopy($src_file, $dst_file);
     }


Next Copyright © 2002 M. J. Dominus