Browse Source

- remove dead code

master
Andreas Romeyke 2 months ago
parent
commit
b9316f7965
1 changed files with 1 additions and 17 deletions
  1. +1
    -17
      bin/pronomidentify.pl

+ 1
- 17
bin/pronomidentify.pl View File

@@ -18,7 +18,7 @@
use strict;
use warnings 'FATAL';
use utf8;
use v5.24;
use feature qw(say);
use Fcntl qw(:seek);
use File::Map qw(:map :extra);
use File::FormatIdentification::Pronom;
@@ -52,36 +52,20 @@ if ( !defined $binaryfile ) {
exit;
}


# write basic main.osd

open( my $filehandle, "<", "$binaryfile" );
binmode($filehandle);
seek( $filehandle, 0, SEEK_END );
my $eof = tell($filehandle);
close $filehandle;

my $pronom = File::FormatIdentification::Pronom->new(
"droid_signature_filename" => $pronomfile
);


#my $pathobj = path($binaryfile);
#my $filestream = $pathobj->slurp_raw;
map_file my $filestream, $binaryfile, "<";
advise( $filestream, 'random' );


foreach my $internalid ( $pronom->get_all_internal_ids() ) {
my $sig = $pronom->get_signature_id_by_internal_id($internalid);
if (!defined $sig) {next;}
my $puid = $pronom->get_puid_by_signature_id($sig);
my $name = $pronom->get_name_by_signature_id($sig);
my $quality = $pronom->get_qualities_by_internal_id($internalid);

my @regexes = $pronom->get_regular_expressions_by_internal_id($internalid);
my @res;
my $timer = time;
if ( all {$filestream =~ m/$_/saa} @regexes ) {
say "$binaryfile identified as $name with PUID $puid (regex quality $quality)";
}


Loading…
Cancel
Save