line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Find::Rule::Ext2::FileAttributes; |
2
|
1
|
|
|
1
|
|
28272
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
1124
|
use File::Find::Rule; |
|
1
|
|
|
|
|
9197
|
|
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
1035
|
use Linux::Ext2::FileAttributes; |
|
1
|
|
|
|
|
850
|
|
|
1
|
|
|
|
|
85
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw( File::Find::Rule ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
105
|
|
8
|
1
|
|
|
1
|
|
5
|
use vars qw( $VERSION @EXPORT ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
179
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
@EXPORT = @File::Find::Rule::EXPORT; |
11
|
|
|
|
|
|
|
$VERSION = '0.02'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
File::Find::Rule::Ext2::FileAttributes - rules to match on Ext2::FileAttributes |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use File::Find::Rule::Ext2::FileAttributes; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my @immutable = File::Find::Rule->immutable->in( '.' ); |
22
|
|
|
|
|
|
|
print "@immutable\n"; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my @appendable = File::Find::Rule->appendable->in( '.' ); |
25
|
|
|
|
|
|
|
print "@appendable\n"; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
File::Find::Rule::Ext2::FileAttributes wraps the |
30
|
|
|
|
|
|
|
Linux::Ext2::FileAttributes module and allows you to filter files by the |
31
|
|
|
|
|
|
|
immutable or appendable extended attributes using File::Find::Rule. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=over |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item immutable |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This method filters on the immutable flag. If this flag is set on a file |
40
|
|
|
|
|
|
|
even root cannot change the files content or unlink it without first |
41
|
|
|
|
|
|
|
removing the flag. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item appendable |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
This method filters on the append only flag. If this flag is set on a |
46
|
|
|
|
|
|
|
file then its contents can be added to but not removed unless the flag is |
47
|
|
|
|
|
|
|
first removed. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=back |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub File::Find::Rule::immutable () { |
55
|
0
|
|
|
0
|
0
|
|
my $self = shift()->_force_object; |
56
|
0
|
|
|
0
|
|
|
$self->exec( sub { is_immutable( $_ ) } ); |
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub File::Find::Rule::appendable () { |
60
|
0
|
|
|
0
|
0
|
|
my $self = shift()->_force_object; |
61
|
0
|
|
|
0
|
|
|
$self->exec( sub { is_append_only( $_ ) } ); |
|
0
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |