line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SFTP::Foreign::Attributes::Compat; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use Net::SFTP::Foreign::Attributes; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
122
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::SFTP::Foreign::Attributes); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @fields = qw( flags size uid gid perm atime mtime ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
for my $f (@fields) { |
14
|
1
|
|
|
1
|
|
7
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
203
|
|
15
|
0
|
0
|
0
|
0
|
|
|
*$f = sub { @_ > 1 ? $_[0]->{$f} = $_[1] : $_[0]->{$f} || 0 } |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
0
|
|
|
0
|
1
|
|
my ($class, %param) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $a = $class->SUPER::new(); |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
if (my $stat = $param{Stat}) { |
24
|
0
|
|
|
|
|
|
$a->set_size($stat->[7]); |
25
|
0
|
|
|
|
|
|
$a->set_ugid($stat->[4], $stat->[5]); |
26
|
0
|
|
|
|
|
|
$a->set_perm($stat->[2]); |
27
|
0
|
|
|
|
|
|
$a->set_amtime($stat->[8], $stat->[9]); |
28
|
|
|
|
|
|
|
} |
29
|
0
|
|
|
|
|
|
$a; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |