| Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Archive/Zip/DirectoryMember.pm |
| Statements | Executed 11 statements in 291µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 9µs | 11µs | Archive::Zip::DirectoryMember::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 6µs | Archive::Zip::DirectoryMember::BEGIN@8 |
| 1 | 1 | 1 | 4µs | 32µs | Archive::Zip::DirectoryMember::BEGIN@4 |
| 1 | 1 | 1 | 4µs | 20µs | Archive::Zip::DirectoryMember::BEGIN@6 |
| 1 | 1 | 1 | 3µs | 85µs | Archive::Zip::DirectoryMember::BEGIN@13 |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::DirectoryMember::_newNamed |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::DirectoryMember::contents |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::DirectoryMember::externalFileName |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::DirectoryMember::extractToFileNamed |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::DirectoryMember::fileName |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::DirectoryMember::isDirectory |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Archive::Zip::DirectoryMember; | ||||
| 2 | |||||
| 3 | 2 | 18µs | 2 | 12µ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 # spent 11µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@3
# spent 2µs making 1 call to strict::import |
| 4 | 2 | 17µs | 2 | 61µ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 # spent 32µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@4
# spent 29µs making 1 call to Exporter::import |
| 5 | |||||
| 6 | 2 | 27µs | 2 | 36µ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 # 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 | ||||
| 9 | 1 | 200ns | $VERSION = '1.68'; | ||
| 10 | 1 | 7µs | @ISA = qw( Archive::Zip::Member ); | ||
| 11 | 1 | 25µs | 1 | 6µs | } # spent 6µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@8 |
| 12 | |||||
| 13 | 1 | 2µs | 1 | 82µ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 # spent 82µs making 1 call to Exporter::import |
| 14 | :ERROR_CODES | ||||
| 15 | :UTILITY_METHODS | ||||
| 16 | 1 | 193µs | 1 | 85µs | ); # spent 85µs making 1 call to Archive::Zip::DirectoryMember::BEGIN@13 |
| 17 | |||||
| 18 | sub _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 | |||||
| 50 | sub externalFileName { | ||||
| 51 | shift->{'externalFileName'}; | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | sub isDirectory { | ||||
| 55 | return 1; | ||||
| 56 | } | ||||
| 57 | |||||
| 58 | sub 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 | |||||
| 67 | sub 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... | ||||
| 76 | sub contents { | ||||
| 77 | return wantarray ? (undef, AZ_OK) : undef; | ||||
| 78 | } | ||||
| 79 | |||||
| 80 | 1 | 2µs | 1; |