Changeset 14221 for gsdl/trunk
- Timestamp:
- 2007-07-07T11:30:17+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/util.pm
r14175 r14221 26 26 package util; 27 27 28 BEGIN { 29 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 30 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'}; 31 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 32 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 33 } 28 34 use File::Copy; 29 35 use File::Basename; 30 36 #use Win32::Hardlink; 31 37 32 38 # removes files (but not directories) … … 381 387 # link not supported on windows 9x 382 388 if (($ENV{'GSDLOS'} =~ /^windows$/i) && (Win32::FsType() !~ /^ntfs$/i)) { 389 print STDERR "util::hard_link: win32: using copy for hard link.\n"; 383 390 &File::Copy::copy ($src, $dest); 384 391 … … 407 414 my $dest_dir = &File::Basename::dirname($dest); 408 415 mk_all_dir($dest_dir) if (!-e $dest_dir); 409 416 417 # symlink not supported on windows 410 418 if ($ENV{'GSDLOS'} =~ /^windows$/i) { 411 # symlink not supported on windows 412 &File::Copy::copy ($src, $dest); 419 420 if ( (Win32::FsType() =~ /^ntfs$/i) && 421 ($src =~ /^.:\\.*/) && ($dest =~ /^.:\\.*/) && 422 (substr($src,0,3) eq substr($dest,0,3)) ) { 423 424 # if filesystem is NTFS and both source and destination is on the same local drive, 425 # use hardlink instead of symlink 426 #print STDERR "util::soft_link: win32: using hard link instead of soft ink.\n"; 427 require Win32::Hardlink; 428 hard_link($src,$dest); 429 } else { 430 #print STDERR "util::soft_link: win32: using copy for soft link.\n "; 431 &File::Copy::copy ($src, $dest); 432 } 413 433 414 434 } elsif (!eval {symlink($src, $dest)}) {
Note:
See TracChangeset
for help on using the changeset viewer.