← Index
NYTProf Performance Profile   « line view »
For t/bug-md-11.t
  Run on Fri Mar 8 13:27:24 2024
Reported on Fri Mar 8 13:30:23 2024

Filename/home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Archive/Zip/DirectoryMember.pm
StatementsExecuted 11 statements in 291µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs11µsArchive::Zip::DirectoryMember::::BEGIN@3Archive::Zip::DirectoryMember::BEGIN@3
1116µs6µsArchive::Zip::DirectoryMember::::BEGIN@8Archive::Zip::DirectoryMember::BEGIN@8
1114µs32µsArchive::Zip::DirectoryMember::::BEGIN@4Archive::Zip::DirectoryMember::BEGIN@4
1114µs20µsArchive::Zip::DirectoryMember::::BEGIN@6Archive::Zip::DirectoryMember::BEGIN@6
1113µs85µsArchive::Zip::DirectoryMember::::BEGIN@13Archive::Zip::DirectoryMember::BEGIN@13
0000s0sArchive::Zip::DirectoryMember::::_newNamedArchive::Zip::DirectoryMember::_newNamed
0000s0sArchive::Zip::DirectoryMember::::contentsArchive::Zip::DirectoryMember::contents
0000s0sArchive::Zip::DirectoryMember::::externalFileNameArchive::Zip::DirectoryMember::externalFileName
0000s0sArchive::Zip::DirectoryMember::::extractToFileNamedArchive::Zip::DirectoryMember::extractToFileNamed
0000s0sArchive::Zip::DirectoryMember::::fileNameArchive::Zip::DirectoryMember::fileName
0000s0sArchive::Zip::DirectoryMember::::isDirectoryArchive::Zip::DirectoryMember::isDirectory
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Archive::Zip::DirectoryMember;
2
3218µs212µs
# spent 11µs (9+2) within Archive::Zip::DirectoryMember::BEGIN@3 which was called: # once (9µs+2µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 3
use strict;
# spent 11µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@3 # spent 2µs making 1 call to strict::import
4217µs261µs
# spent 32µs (4+29) within Archive::Zip::DirectoryMember::BEGIN@4 which was called: # once (4µs+29µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 4
use File::Path;
# spent 32µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@4 # spent 29µs making 1 call to Exporter::import
5
6227µs236µs
# spent 20µs (4+16) within Archive::Zip::DirectoryMember::BEGIN@6 which was called: # once (4µs+16µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 6
use vars qw( $VERSION @ISA );
# spent 20µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@6 # spent 16µs making 1 call to vars::import
7
8
# spent 6µs within Archive::Zip::DirectoryMember::BEGIN@8 which was called: # once (6µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 11
BEGIN {
91200ns $VERSION = '1.68';
1017µs @ISA = qw( Archive::Zip::Member );
11125µs16µs}
# spent 6µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@8
12
1312µs182µs
# spent 85µs (3+82) within Archive::Zip::DirectoryMember::BEGIN@13 which was called: # once (3µs+82µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 16
use Archive::Zip qw(
# spent 82µs making 1 call to Exporter::import
14 :ERROR_CODES
15 :UTILITY_METHODS
161193µs185µs);
# spent 85µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@13
17
18sub _newNamed {
19 my $class = shift;
20 my $fileName = shift; # FS name
21 my $newName = shift; # Zip name
22 $newName = _asZipDirName($fileName) unless $newName;
23 my $self = $class->new(@_);
24 $self->{'externalFileName'} = $fileName;
25 $self->fileName($newName);
26
27 if (-e $fileName) {
28
29 # -e does NOT do a full stat, so we need to do one now
30 if (-d _ ) {
31 my @stat = stat(_);
32 $self->unixFileAttributes($stat[2]);
33 my $mod_t = $stat[9];
34 if ($^O eq 'MSWin32' and !$mod_t) {
35 $mod_t = time();
36 }
37 $self->setLastModFileDateTimeFromUnix($mod_t);
38
39 } else { # hmm.. trying to add a non-directory?
40 _error($fileName, ' exists but is not a directory');
41 return undef;
42 }
43 } else {
44 $self->unixFileAttributes($self->DEFAULT_DIRECTORY_PERMISSIONS);
45 $self->setLastModFileDateTimeFromUnix(time());
46 }
47 return $self;
48}
49
50sub externalFileName {
51 shift->{'externalFileName'};
52}
53
54sub isDirectory {
55 return 1;
56}
57
58sub extractToFileNamed {
59 my $self = shift;
60 my $name = shift; # local FS name
61 my $attribs = $self->unixFileAttributes() & 07777;
62 mkpath($name, 0, $attribs); # croaks on error
63 utime($self->lastModTime(), $self->lastModTime(), $name);
64 return AZ_OK;
65}
66
67sub fileName {
68 my $self = shift;
69 my $newName = shift;
70 $newName =~ s{/?$}{/} if defined($newName);
71 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...
76sub contents {
77 return wantarray ? (undef, AZ_OK) : undef;
78}
79
8012µs1;