Revision: | 1.13 |
Committed: | Wed Feb 2 20:16:46 2005 UTC (20 years, 3 months ago) by sashby |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | V1_1_7, V1_1_6, V1_1_5, V1_2_0-cand3, V1_2_0-cand2, V1_2_0-cand1, V1_1_4, V1_1_3, V1_1_2, V1_1_0_reltag8, V1_1_0_reltag7, V1_1_0_reltag6, V1_1_1, V1_1_0_reltag5, V1_1_0_reltag4, V1_1_0_reltag3, V1_1_0_reltag2, V1_1_0_reltag1, V1_1_0_reltag, V1_0_3-p4, V1_1_0_cand3, V1_1_0_cand2, V1_1_0_cand1, HEAD_SM_071214, forV1_1_0, v103_xml_071106, V1_0_3-p3, V1_0_3-p2, V1_1_0, v110p1, V110p6, V110p5, V110p4, V110p3, before110xmlBRmerge, V110p2, V110p1, V1_0_4p1, V1_0_3-p1, V1_0_3, V1_0_2, V1_0_2_p1, v102p1, V1_0_1 |
Branch point for: | forBinLess_SCRAM, HEAD_BRANCH_SM_071214, v200branch, v103_with_xml, v103_branch |
Changes since 1.12: | +1 -2 lines |
Log Message: | Some more tidying of file permissions for downloaded/cached files. |
# | 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 | my $filename=$url->path(); |
20 | |
21 | if ( -e $filename ) { |
22 | if ( -d $filename ) { #- directory copy |
23 | require Utilities::AddDir; |
24 | AddDir::copydir($filename,$location); |
25 | } |
26 | else { |
27 | copy ( $filename,$location) || die "Unable to copy file $filename --> " |
28 | ."$location \n$!\n"; |
29 | } |
30 | $rv=$location; |
31 | } |
32 | else { |
33 | $rv=""; |
34 | } |
35 | return $rv; |
36 | } |