Changeset 983


Ignore:
Timestamp:
2000-02-28T11:11:18+13:00 (24 years ago)
Author:
sjboddie
Message:

link() function isn't supported on windows - use copy

File:
1 edited

Legend:

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

    r836 r983  
    274274# make hard link to file if supported by OS, otherwise copy the file
    275275sub hard_link {
    276     my ($src,$dest) = @_;
     276    my ($src, $dest) = @_;
    277277
    278278    # remove trailing slashes from source and destination files
     
    297297    mk_all_dir($dest_dir) if (!-e $dest_dir);
    298298
    299     if (!link($src,$dest))
    300     {
     299    # link not supported on wondows
     300    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     301    &File::Copy::copy ($src, $dest);
     302
     303    } elsif (!link($src, $dest)) {
    301304    print STDERR "util::hard_link: unable to create hard link. ";
    302305    print STDERR " Attempting to copy file: $src -> $dest\n";
    303306    &File::Copy::copy ($src, $dest);
    304307    }
    305    
    306308}
    307309
    308310# make soft link to file if supported by OS, otherwise return error
    309311sub soft_link {
    310     my ($src,$dest) = @_;
     312    my ($src, $dest) = @_;
    311313
    312314    # remove trailing slashes from source and destination files
     
    323325    mk_all_dir($dest_dir) if (!-e $dest_dir);
    324326
    325     if (!symlink($src,$dest))
     327    if (!symlink($src, $dest))
    326328    {
    327329    print STDERR "util::soft_link: unable to create soft link.";
Note: See TracChangeset for help on using the changeset viewer.