Numbering, moving, and copying for non-email files completed.

This commit is contained in:
Bradley M. Kuhn 2023-06-03 07:56:11 -07:00
parent c2cadeaa6a
commit 9da387af88

View file

@ -100,7 +100,13 @@ sub ProcessDocumentDirectory($$$) {
if (-d $fullFilePath) {
ProcessDocumentDirectory($rfp, $fullFilePath, catfile($numberedOutputDir, $file));
} elsif (-f $fullFilePath) {
print " mv $fullFilePath ", catfile($numberedOutputDir, $file), "\n";
my $upiFull = NextUPI();
make_path($numberedOutputDir, { mode => 0755 });
my($volume, $directories, $bareFileName) = File::Spec->splitpath($fullFilePath);
die("Something wrong, since file name is empty on $fullFilePath") unless defined $bareFileName and $bareFileName !~ /^\s*$/;
my $fileName = $upiFull . '-' . $GROUP_NAMES_BY_DIR{$GROUP} . '-' . $bareFileName;
my $copiedFile = catfile($numberedOutputDir, $fileName);
copy($fullFilePath, catfile($numberedOutputDir, $fileName));
} else {
die("\"$fullFilePath\" is a strange file type, not handled!");
}
@ -197,10 +203,10 @@ while (my $rfp = readdir $topDH) {
make_path($numberedOutputDir, { mode => 0755 });
if ($typeName =~ /email/i) {
ProcessMailDir($rfp, $typeDirName, $numberedOutputDir);
move($typeDirName, $nativeOutputDirOneUp);
} else {
ProcessDocumentDirectory($rfp, $typeDirName, $numberedOutputDir);
}
move($typeDirName, $nativeOutputDirOneUp);
}
closedir $bucketDH;
}