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
|
|
|
|
|
33
|
|
|
27
|
|
|
|
|
590
|
|
11
|
27
|
|
|
27
|
|
81
|
use warnings; |
|
27
|
|
|
|
|
29
|
|
|
27
|
|
|
|
|
555
|
|
12
|
|
|
|
|
|
|
|
13
|
27
|
|
|
27
|
|
8920
|
use Filesys::POSIX::Directory (); |
|
27
|
|
|
|
|
46
|
|
|
27
|
|
|
|
|
6568
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @ISA = qw(Filesys::POSIX::Directory); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
194
|
|
|
194
|
0
|
301
|
my ( $class, %initial ) = @_; |
19
|
194
|
|
|
|
|
561
|
return bless \%initial, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get { |
23
|
1193
|
|
|
1193
|
1
|
966
|
my ( $self, $name ) = @_; |
24
|
1193
|
|
|
|
|
2165
|
return $self->{$name}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub set { |
28
|
290
|
|
|
290
|
1
|
248
|
my ( $self, $name, $inode ) = @_; |
29
|
290
|
|
|
|
|
375
|
$self->{$name} = $inode; |
30
|
290
|
|
|
|
|
359
|
return $inode; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub exists { |
34
|
279
|
|
|
279
|
1
|
257
|
my ( $self, $name ) = @_; |
35
|
279
|
|
|
|
|
700
|
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
|
|
|
|
|
12
|
delete $self->{$name}; |
43
|
|
|
|
|
|
|
|
44
|
9
|
|
|
|
|
12
|
return $inode; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub delete { |
48
|
3
|
|
|
3
|
1
|
3
|
my ( $self, $name ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
|
|
5
|
return $self->detach($name); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub list { |
54
|
42
|
|
|
42
|
1
|
41
|
my ($self) = @_; |
55
|
42
|
|
|
|
|
106
|
return keys %$self; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub count { |
59
|
4
|
|
|
4
|
1
|
5
|
my ($self) = @_; |
60
|
4
|
|
|
|
|
20
|
return scalar keys %$self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub open { |
64
|
84
|
|
|
84
|
1
|
79
|
my ($self) = @_; |
65
|
|
|
|
|
|
|
|
66
|
84
|
|
|
|
|
104
|
$self->rewind; |
67
|
|
|
|
|
|
|
|
68
|
84
|
|
|
|
|
120
|
return $self; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub rewind { |
72
|
84
|
|
|
84
|
1
|
61
|
my ($self) = @_; |
73
|
|
|
|
|
|
|
|
74
|
84
|
|
|
|
|
142
|
keys %$self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub read { |
78
|
400
|
|
|
400
|
1
|
281
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
400
|
|
|
|
|
934
|
each %$self; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub close { |
84
|
84
|
|
|
84
|
1
|
236
|
return; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |