line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2014, cPanel, Inc. |
2
|
|
|
|
|
|
|
# All rights reserved. |
3
|
|
|
|
|
|
|
# http://cpanel.net/ |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the same |
6
|
|
|
|
|
|
|
# terms as Perl itself. See the LICENSE file for further details. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Filesys::POSIX::Mem::Directory; |
9
|
|
|
|
|
|
|
|
10
|
27
|
|
|
27
|
|
95
|
use strict; |
|
27
|
|
|
|
|
29
|
|
|
27
|
|
|
|
|
588
|
|
11
|
27
|
|
|
27
|
|
81
|
use warnings; |
|
27
|
|
|
|
|
26
|
|
|
27
|
|
|
|
|
534
|
|
12
|
|
|
|
|
|
|
|
13
|
27
|
|
|
27
|
|
8550
|
use Filesys::POSIX::Directory (); |
|
27
|
|
|
|
|
45
|
|
|
27
|
|
|
|
|
6416
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @ISA = qw(Filesys::POSIX::Directory); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
194
|
|
|
194
|
0
|
289
|
my ( $class, %initial ) = @_; |
19
|
194
|
|
|
|
|
519
|
return bless \%initial, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get { |
23
|
1193
|
|
|
1193
|
1
|
937
|
my ( $self, $name ) = @_; |
24
|
1193
|
|
|
|
|
2169
|
return $self->{$name}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub set { |
28
|
290
|
|
|
290
|
1
|
294
|
my ( $self, $name, $inode ) = @_; |
29
|
290
|
|
|
|
|
368
|
$self->{$name} = $inode; |
30
|
290
|
|
|
|
|
367
|
return $inode; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub exists { |
34
|
279
|
|
|
279
|
1
|
228
|
my ( $self, $name ) = @_; |
35
|
279
|
|
|
|
|
673
|
return exists $self->{$name}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub detach { |
39
|
9
|
|
|
9
|
1
|
9
|
my ( $self, $name ) = @_; |
40
|
9
|
|
|
|
|
11
|
my $inode = $self->{$name}; |
41
|
|
|
|
|
|
|
|
42
|
9
|
|
|
|
|
13
|
delete $self->{$name}; |
43
|
|
|
|
|
|
|
|
44
|
9
|
|
|
|
|
10
|
return $inode; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub delete { |
48
|
3
|
|
|
3
|
1
|
3
|
my ( $self, $name ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
|
|
4
|
return $self->detach($name); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub list { |
54
|
42
|
|
|
42
|
1
|
40
|
my ($self) = @_; |
55
|
42
|
|
|
|
|
100
|
return keys %$self; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub count { |
59
|
4
|
|
|
4
|
1
|
3
|
my ($self) = @_; |
60
|
4
|
|
|
|
|
17
|
return scalar keys %$self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub open { |
64
|
84
|
|
|
84
|
1
|
60
|
my ($self) = @_; |
65
|
|
|
|
|
|
|
|
66
|
84
|
|
|
|
|
109
|
$self->rewind; |
67
|
|
|
|
|
|
|
|
68
|
84
|
|
|
|
|
123
|
return $self; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub rewind { |
72
|
84
|
|
|
84
|
1
|
73
|
my ($self) = @_; |
73
|
|
|
|
|
|
|
|
74
|
84
|
|
|
|
|
135
|
keys %$self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub read { |
78
|
400
|
|
|
400
|
1
|
275
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
400
|
|
|
|
|
906
|
each %$self; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub close { |
84
|
84
|
|
|
84
|
1
|
253
|
return; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |