line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::file_size; |
2
|
2
|
|
|
2
|
|
1032
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
110200
|
|
|
2
|
|
|
|
|
12
|
|
3
|
2
|
|
|
2
|
|
355
|
use Moo; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
9
|
|
4
|
2
|
|
|
2
|
|
791
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
711
|
|
|
2
|
|
|
|
|
12
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub emit_value { |
11
|
1
|
|
|
1
|
0
|
6159
|
my ($self, $var) = @_; |
12
|
1
|
|
|
|
|
6
|
"${var} = is_string(${var}) && -f ${var} ? (-s ${var}) : 0;"; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Catmandu::Fix::file_size - get file size |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
add_field('path','/home/njfranck/test.txt') |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#'path' is now the file size of file /home/njfranck/test.txt |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
file_size('path') |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 AUTHOR |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Nicolas Franck, C<< <nicolas.franck at ugent.be> >> |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SEE ALSO |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
L<Catmandu::Fix> |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |