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
|
26
|
|
|
26
|
|
109
|
use strict; |
|
26
|
|
|
|
|
45
|
|
|
26
|
|
|
|
|
834
|
|
11
|
26
|
|
|
26
|
|
112
|
use warnings; |
|
26
|
|
|
|
|
38
|
|
|
26
|
|
|
|
|
662
|
|
12
|
|
|
|
|
|
|
|
13
|
26
|
|
|
26
|
|
9143
|
use Filesys::POSIX::Directory (); |
|
26
|
|
|
|
|
52
|
|
|
26
|
|
|
|
|
7343
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @ISA = qw(Filesys::POSIX::Directory); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
192
|
|
|
192
|
0
|
402
|
my ( $class, %initial ) = @_; |
19
|
192
|
|
|
|
|
702
|
return bless \%initial, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get { |
23
|
1154
|
|
|
1154
|
1
|
1256
|
my ( $self, $name ) = @_; |
24
|
1154
|
|
|
|
|
2626
|
return $self->{$name}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub set { |
28
|
286
|
|
|
286
|
1
|
315
|
my ( $self, $name, $inode ) = @_; |
29
|
286
|
|
|
|
|
458
|
$self->{$name} = $inode; |
30
|
286
|
|
|
|
|
420
|
return $inode; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub exists { |
34
|
275
|
|
|
275
|
1
|
276
|
my ( $self, $name ) = @_; |
35
|
275
|
|
|
|
|
785
|
return exists $self->{$name}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub detach { |
39
|
9
|
|
|
9
|
1
|
13
|
my ( $self, $name ) = @_; |
40
|
9
|
|
|
|
|
13
|
my $inode = $self->{$name}; |
41
|
|
|
|
|
|
|
|
42
|
9
|
|
|
|
|
20
|
delete $self->{$name}; |
43
|
|
|
|
|
|
|
|
44
|
9
|
|
|
|
|
18
|
return $inode; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub delete { |
48
|
3
|
|
|
3
|
1
|
8
|
my ( $self, $name ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
|
|
9
|
return $self->detach($name); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub list { |
54
|
40
|
|
|
40
|
1
|
42
|
my ($self) = @_; |
55
|
40
|
|
|
|
|
152
|
return keys %$self; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub count { |
59
|
4
|
|
|
4
|
1
|
5
|
my ($self) = @_; |
60
|
4
|
|
|
|
|
24
|
return scalar keys %$self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub open { |
64
|
84
|
|
|
84
|
1
|
70
|
my ($self) = @_; |
65
|
|
|
|
|
|
|
|
66
|
84
|
|
|
|
|
139
|
$self->rewind; |
67
|
|
|
|
|
|
|
|
68
|
84
|
|
|
|
|
116
|
return $self; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub rewind { |
72
|
84
|
|
|
84
|
1
|
70
|
my ($self) = @_; |
73
|
|
|
|
|
|
|
|
74
|
84
|
|
|
|
|
140
|
keys %$self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub read { |
78
|
400
|
|
|
400
|
1
|
315
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
400
|
|
|
|
|
1067
|
each %$self; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub close { |
84
|
84
|
|
|
84
|
1
|
280
|
return; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |