| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
5
|
|
|
5
|
|
1129
|
use strict; use warnings; |
|
|
5
|
|
|
5
|
|
9
|
|
|
|
5
|
|
|
|
|
174
|
|
|
|
5
|
|
|
|
|
23
|
|
|
|
5
|
|
|
|
|
5
|
|
|
|
5
|
|
|
|
|
192
|
|
|
2
|
|
|
|
|
|
|
package IO::All::Link; |
|
3
|
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
1067
|
use IO::All::File -base; |
|
|
5
|
|
|
|
|
9
|
|
|
|
5
|
|
|
|
|
48
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
const type => 'link'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub link { |
|
9
|
9
|
|
|
9
|
1
|
10
|
my $self = shift; |
|
10
|
9
|
|
|
|
|
20
|
bless $self, __PACKAGE__; |
|
11
|
9
|
50
|
|
|
|
58
|
$self->name(shift) if @_; |
|
12
|
9
|
|
|
|
|
37
|
$self->_init; |
|
13
|
|
|
|
|
|
|
} |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub readlink { |
|
16
|
3
|
|
|
3
|
1
|
37
|
my $self = shift; |
|
17
|
3
|
|
|
|
|
10
|
$self->_constructor->(CORE::readlink($self->name)); |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub symlink { |
|
21
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
|
22
|
0
|
|
|
|
|
0
|
my $target = shift; |
|
23
|
0
|
0
|
|
|
|
0
|
$self->assert_filepath if $self->_assert; |
|
24
|
0
|
|
|
|
|
0
|
CORE::symlink($target, $self->pathname); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub AUTOLOAD { |
|
28
|
2
|
|
|
2
|
|
11
|
my $self = shift; |
|
29
|
2
|
|
|
|
|
2
|
our $AUTOLOAD; |
|
30
|
2
|
|
|
|
|
14
|
(my $method = $AUTOLOAD) =~ s/.*:://; |
|
31
|
2
|
|
|
|
|
5
|
my $target = $self->target; |
|
32
|
2
|
50
|
|
|
|
7
|
unless ($target) { |
|
33
|
0
|
|
|
|
|
0
|
$self->throw("Can't call $method on symlink"); |
|
34
|
0
|
|
|
|
|
0
|
return; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
2
|
|
|
|
|
8
|
$target->$method(@_); |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub target { |
|
40
|
2
|
|
|
2
|
0
|
3
|
my $self = shift; |
|
41
|
2
|
100
|
|
|
|
14
|
return *$self->{target} if *$self->{target}; |
|
42
|
1
|
|
|
|
|
2
|
my %seen; |
|
43
|
1
|
|
|
|
|
1
|
my $link = $self; |
|
44
|
1
|
|
|
|
|
2
|
my $new; |
|
45
|
1
|
|
|
|
|
3
|
while ($new = $link->readlink) { |
|
46
|
1
|
50
|
|
|
|
4
|
my $type = $new->type or return; |
|
47
|
1
|
50
|
|
|
|
4
|
last if $type eq 'file'; |
|
48
|
1
|
50
|
|
|
|
4
|
last if $type eq 'dir'; |
|
49
|
0
|
0
|
|
|
|
0
|
return unless $type eq 'link'; |
|
50
|
0
|
0
|
|
|
|
0
|
return if $seen{$new->name}++; |
|
51
|
0
|
|
|
|
|
0
|
$link = $new; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
1
|
|
|
|
|
173
|
*$self->{target} = $new; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
sub exists { -l shift->pathname } |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |