Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rosettaDeepFixity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
rosettaDeepFixity
Commits
88d1b20d
Commit
88d1b20d
authored
4 years ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- added sysseek check to end, to detect if there is an GPFS problem…
parent
617c8934
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deep_fixitycheck.pl
+22
-4
22 additions, 4 deletions
deep_fixitycheck.pl
with
22 additions
and
4 deletions
deep_fixitycheck.pl
+
22
−
4
View file @
88d1b20d
...
...
@@ -30,6 +30,7 @@ use Getopt::Long;
use
constant
DEBUG
=>
0
;
# no debug
use
Pod::
Usage
;
use
IO::
Handle
;
use
Fcntl
qw(SEEK_END SEEK_SET)
;
STDOUT
->
autoflush
(
1
);
# guarantee, that output will be UTF8
binmode
(
STDOUT
,
"
:encoding(UTF-8)
");
...
...
@@ -236,6 +237,17 @@ sub check_file_size($$) {
return $result;
}
sub check_file_seekable($$) {
my $fileobj = shift;
my $result = shift;
my $fh = pa
th
(
$fileobj
->
{
file_mounted
})
->
openr_raw
();
$result
->
{
seekable
}
=
sysseek
(
$fh
,
0
,
SEEK_END
);
if
(
!
$result
->
{
seekable
})
{
add_error
(
$fileobj
,
$result
,
"
is not seekable, $!
");
}
return
$result
;
}
# check if referenced file has correct checksum for given algorithm
sub
check_file_fixity
($$$)
{
my
$fileobj
=
shift
;
...
...
@@ -322,11 +334,17 @@ if (defined $search_dir && -d "$search_dir") {
my
$result
;
$result
->
{
errors
}
=
0
;
$result
=
check_if_file_exist
(
$fileobj
,
$result
);
if
(
$result
->
{
exist
})
{
# only if file exists, do additional checks
if
(
$result
->
{
exist
})
{
# only if file exists, do additional checks
$result
=
check_file_size
(
$fileobj
,
$result
);
foreach
my
$fixity_algorithm
(
@algorithms
)
{
if
(
$fileobj
->
{
fixity
}
->
{
$fixity_algorithm
})
{
$result
=
check_file_fixity
(
$fileobj
,
$result
,
$fixity_algorithm
);
if
(
$result
->
{
size
})
{
$result
=
check_file_seekable
(
$fileobj
,
$result
);
if
(
$result
->
{
seekable
})
{
foreach
my
$fixity_algorithm
(
@algorithms
)
{
if
(
$fileobj
->
{
fixity
}
->
{
$fixity_algorithm
})
{
$result
=
check_file_fixity
(
$fileobj
,
$result
,
$fixity_algorithm
);
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment