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

# Content
1 #
2 # standard url interface for local file
3 #
4 # Interface
5 # ---------
6 # new() :
7 # get(url, destination) :
8
9 package URL::URL_file;
10 require 5.001;
11 use File::Copy;
12 use URL::URL_base;
13 @ISA=qw(URL::URL_base);
14
15 sub get {
16 my $self=shift;
17 my $url=shift;
18 my $location=shift;
19
20 my $filename=$url->path();
21
22 if ( -e $filename ) {
23 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 ."$location \n$!\n";
30 }
31 $rv=$location;
32 }
33 else {
34 $rv="";
35 }
36 return $rv;
37 }