examples/disk.pl

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.6% 13 / 15 CC 1 SCAR 0.7
CC
1
Cov
82%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« examples/defilter.pl ↑ Summary examples/extract.pl »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 0 ▶use Archive::Libarchive qw( :const );
Subroutine BEGIN: called CC=1 SCAR=2.6
5  
6 my $dw = Archive::Libarchive::DiskWrite->new;
7 $dw->disk_set_options(ARCHIVE_EXTRACT_TIME);
8  
9 my $text = "Hello World!\n";
10  
11 my $e = Archive::Libarchive::Entry->new;
12 $e->set_pathname("hello.txt");
13 $e->set_filetype('reg');
14 $e->set_size(length $text);
15 $e->set_mtime(time);
16 $e->set_mode(oct('0644'));
17  
18 $dw->write_header($e);
19 $dw->write_data(\$text);
20 $dw->finish_entry;
21  
« examples/defilter.pl ↑ Summary examples/extract.pl »