ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/URL/URL_file.pm
Revision: 1.12
Committed: Fri Jul 12 13:43:26 2002 UTC (22 years, 10 months ago) by sashby
Content type: text/plain
Branch: MAIN
CVS Tags: V1_0_0, V1_pre0, SCRAM_V1, SCRAMV1_IMPORT, V0_19_7, V0_19_6, V0_19_6p1
Branch point for: V1_pre1, SCRAM_V1_BRANCH
Changes since 1.11: +1 -2 lines
Log Message:
Improved CVS interface to allow local CVS repository to be used. Also started tests of new arch checking based on libc version.

File Contents

# User Rev Content
1 williamc 1.1 #
2     # standard url interface for local file
3     #
4     # Interface
5     # ---------
6     # new() :
7     # get(url, destination) :
8    
9 williamc 1.4 package URL::URL_file;
10 williamc 1.1 require 5.001;
11     use File::Copy;
12 williamc 1.9 use URL::URL_base;
13     @ISA=qw(URL::URL_base);
14 williamc 1.1
15     sub get {
16     my $self=shift;
17 williamc 1.5 my $url=shift;
18     my $location=shift;
19 williamc 1.1
20 williamc 1.8 my $filename=$url->path();
21 sashby 1.12
22 williamc 1.5 if ( -e $filename ) {
23 williamc 1.10 if ( -d $filename ) { #- directory copy
24     require Utilities::AddDir;
25     AddDir::copydir($filename,$location);
26     }
27     else {
28     copy ( $filename,$location) || die "Unable to copy file $filename --> "
29 williamc 1.5 ."$location \n$!\n";
30 williamc 1.10 }
31 williamc 1.5 $rv=$location;
32 williamc 1.1 }
33     else {
34 williamc 1.3 $rv="";
35 williamc 1.1 }
36 williamc 1.3 return $rv;
37 williamc 1.1 }