Revision: | 1.8.2.2 |
Committed: | Mon Aug 28 07:03:29 2000 UTC (24 years, 8 months ago) by williamc |
Content type: | text/plain |
Branch: | HPWbranch |
CVS Tags: | BuildSystemProto1, V0_18_0, V0_18_0model, V0_17_1, V0_18_0alpha, V0_17_0, V0_16_4, V0_16_3, V0_16_2, V0_16_1, V0_16_0, V0_15_1, V0_15_0, V0_15_0beta |
Branch point for: | V0_17branch, V0_16branch, V0_15branch |
Changes since 1.8.2.1: | +2 -2 lines |
Log Message: | Update error handling URL |
# | 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.8.2.2 | 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 | williamc | 1.6 | #print $filename; |
22 | williamc | 1.5 | if ( -e $filename ) { |
23 | copy ( $filename,$location) || die "Unable to copy file $filename --> " | ||
24 | ."$location \n$!\n"; | ||
25 | $rv=$location; | ||
26 | williamc | 1.1 | } |
27 | else { | ||
28 | williamc | 1.5 | #print "URL_file : Unable to find file $urlfile : $!\n"; |
29 | williamc | 1.3 | $rv=""; |
30 | williamc | 1.1 | } |
31 | williamc | 1.3 | return $rv; |
32 | williamc | 1.1 | } |