Ignore:
Timestamp:
2000-10-05T15:10:41+13:00 (24 years ago)
Author:
sjboddie
Message:

fixed a bug in the cp_r perl routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/util.pm

    r1454 r1586  
    196196
    197197    } elsif (-d $file) {
    198         print STDERR "directory: $file\n";
     198        # make the new directory
     199        my ($filename) = $file =~ /([^\\\/]*)$/;
     200        $dest = &util::filename_cat ($dest, $filename);
     201        my $store_umask = umask(0002);
     202        mkdir ($dest, 0777);
     203        umask($store_umask);
    199204
    200205        # get the contents of this directory
     
    204209        my @filedir = readdir (INDIR);
    205210        closedir (INDIR);
    206         my $olddest = $dest;
    207211        foreach $f (@filedir) {
    208212            next if $f =~ /^\.\.?$/;
    209213            # copy all the files in this directory
    210214            my $ff = &util::filename_cat ($file, $f);
    211             if (-d $ff) {
    212             # make the new directory
    213             $dest = &util::filename_cat ($dest, $f);
    214             my $store_umask = umask(0002);
    215             mkdir ($dest, 0777);
    216             umask($store_umask);
    217             }
    218             print STDERR "dest: $dest\n";
    219215            &cp_r ($ff, $dest);
    220             $dest = $olddest;
    221216        }
    222217        }
    223218
    224219    } else {
    225         print STDERR "ordinary file: $file --> $dest\n";
    226220        &cp($file, $dest);
    227221    }
Note: See TracChangeset for help on using the changeset viewer.