| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Archive::Zip::DirectoryMember; |
|
2
|
|
|
|
|
|
|
|
|
3
|
28
|
|
|
28
|
|
177
|
use strict; |
|
|
28
|
|
|
|
|
56
|
|
|
|
28
|
|
|
|
|
775
|
|
|
4
|
28
|
|
|
28
|
|
134
|
use File::Path; |
|
|
28
|
|
|
|
|
53
|
|
|
|
28
|
|
|
|
|
1419
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
28
|
|
|
28
|
|
144
|
use vars qw( $VERSION @ISA ); |
|
|
28
|
|
|
|
|
54
|
|
|
|
28
|
|
|
|
|
1545
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
|
9
|
28
|
|
|
28
|
|
92
|
$VERSION = '1.68'; |
|
10
|
28
|
|
|
|
|
1173
|
@ISA = qw( Archive::Zip::Member ); |
|
11
|
|
|
|
|
|
|
} |
|
12
|
|
|
|
|
|
|
|
|
13
|
28
|
|
|
|
|
14427
|
use Archive::Zip qw( |
|
14
|
|
|
|
|
|
|
:ERROR_CODES |
|
15
|
|
|
|
|
|
|
:UTILITY_METHODS |
|
16
|
28
|
|
|
28
|
|
205
|
); |
|
|
28
|
|
|
|
|
54
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _newNamed { |
|
19
|
19
|
|
|
19
|
|
58
|
my $class = shift; |
|
20
|
19
|
|
|
|
|
43
|
my $fileName = shift; # FS name |
|
21
|
19
|
|
|
|
|
50
|
my $newName = shift; # Zip name |
|
22
|
19
|
100
|
|
|
|
86
|
$newName = _asZipDirName($fileName) unless $newName; |
|
23
|
19
|
|
|
|
|
227
|
my $self = $class->new(@_); |
|
24
|
19
|
|
|
|
|
84
|
$self->{'externalFileName'} = $fileName; |
|
25
|
19
|
|
|
|
|
109
|
$self->fileName($newName); |
|
26
|
|
|
|
|
|
|
|
|
27
|
19
|
100
|
|
|
|
376
|
if (-e $fileName) { |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# -e does NOT do a full stat, so we need to do one now |
|
30
|
17
|
50
|
|
|
|
65
|
if (-d _ ) { |
|
31
|
17
|
|
|
|
|
101
|
my @stat = stat(_); |
|
32
|
17
|
|
|
|
|
108
|
$self->unixFileAttributes($stat[2]); |
|
33
|
17
|
|
|
|
|
47
|
my $mod_t = $stat[9]; |
|
34
|
17
|
50
|
33
|
|
|
87
|
if ($^O eq 'MSWin32' and !$mod_t) { |
|
35
|
0
|
|
|
|
|
0
|
$mod_t = time(); |
|
36
|
|
|
|
|
|
|
} |
|
37
|
17
|
|
|
|
|
90
|
$self->setLastModFileDateTimeFromUnix($mod_t); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} else { # hmm.. trying to add a non-directory? |
|
40
|
0
|
|
|
|
|
0
|
_error($fileName, ' exists but is not a directory'); |
|
41
|
0
|
|
|
|
|
0
|
return undef; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
} else { |
|
44
|
2
|
|
|
|
|
31
|
$self->unixFileAttributes($self->DEFAULT_DIRECTORY_PERMISSIONS); |
|
45
|
2
|
|
|
|
|
23
|
$self->setLastModFileDateTimeFromUnix(time()); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
19
|
|
|
|
|
62
|
return $self; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub externalFileName { |
|
51
|
0
|
|
|
0
|
1
|
0
|
shift->{'externalFileName'}; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub isDirectory { |
|
55
|
41
|
|
|
41
|
1
|
128
|
return 1; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub extractToFileNamed { |
|
59
|
12
|
|
|
12
|
1
|
30
|
my $self = shift; |
|
60
|
12
|
|
|
|
|
26
|
my $name = shift; # local FS name |
|
61
|
12
|
|
|
|
|
61
|
my $attribs = $self->unixFileAttributes() & 07777; |
|
62
|
12
|
|
|
|
|
872
|
mkpath($name, 0, $attribs); # croaks on error |
|
63
|
12
|
|
|
|
|
95
|
utime($self->lastModTime(), $self->lastModTime(), $name); |
|
64
|
12
|
|
|
|
|
73
|
return AZ_OK; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub fileName { |
|
68
|
518
|
|
|
518
|
1
|
2249
|
my $self = shift; |
|
69
|
518
|
|
|
|
|
742
|
my $newName = shift; |
|
70
|
518
|
100
|
|
|
|
1233
|
$newName =~ s{/?$}{/} if defined($newName); |
|
71
|
518
|
|
|
|
|
1794
|
return $self->SUPER::fileName($newName); |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# So people don't get too confused. This way it looks like the problem |
|
75
|
|
|
|
|
|
|
# is in their code... |
|
76
|
|
|
|
|
|
|
sub contents { |
|
77
|
0
|
0
|
|
0
|
1
|
|
return wantarray ? (undef, AZ_OK) : undef; |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |