Changeset 14362
- Timestamp:
- 2007-08-13T12:27:36+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/util.pm
r14329 r14362 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; … … 380 386 # link not supported on windows 9x 381 387 if (($ENV{'GSDLOS'} =~ /^windows$/i) && (Win32::FsType() !~ /^ntfs$/i)) { 382 print STDERR "util::hard_link: win32: using copy for hard link.\n"; 383 &File::Copy::copy ($src, $dest); 384 385 } elsif (!link($src, $dest)) { 386 print STDERR "util::hard_link: unable to create hard link. "; 387 print STDERR " Attempting to copy file: $src -> $dest\n"; 388 &File::Copy::copy ($src, $dest); 388 print STDERR "util::hard_link: win32: using copy for hard link.\n"; 389 &File::Copy::copy ($src, $dest); 390 } else { 391 require Win32::Hardlink; 392 if (!link($src, $dest)) { 393 print STDERR "util::hard_link: unable to create hard link. "; 394 print STDERR " Attempting to copy file: $src -> $dest\n"; 395 &File::Copy::copy ($src, $dest); 396 } 389 397 } 390 398 return 0; … … 410 418 # symlink not supported on windows 411 419 if ($ENV{'GSDLOS'} =~ /^windows$/i) { 412 413 420 if ( (Win32::FsType() =~ /^ntfs$/i) && 414 421 ($src =~ /^.:\\.*/) && ($dest =~ /^.:\\.*/) && 415 422 (substr($src,0,3) eq substr($dest,0,3)) ) { 416 417 423 # if filesystem is NTFS and both source and destination is on the same local drive, 418 424 # use hardlink instead of symlink 419 #print STDERR "util::soft_link: win32: using hard link instead of soft ink.\n"; 420 require Win32::Hardlink; 421 hard_link($src,$dest); 425 #print STDERR "util::soft_link: win32: using hard link instead of soft ink.\n"; 426 hard_link($src,$dest); 422 427 } else { 423 428 #print STDERR "util::soft_link: win32: using copy for soft link.\n ";
Note:
See TracChangeset
for help on using the changeset viewer.