Numbering, moving, and copying for non-email files completed.
This commit is contained in:
parent
c2cadeaa6a
commit
9da387af88
1 changed files with 8 additions and 2 deletions
|
@ -100,7 +100,13 @@ sub ProcessDocumentDirectory($$$) {
|
||||||
if (-d $fullFilePath) {
|
if (-d $fullFilePath) {
|
||||||
ProcessDocumentDirectory($rfp, $fullFilePath, catfile($numberedOutputDir, $file));
|
ProcessDocumentDirectory($rfp, $fullFilePath, catfile($numberedOutputDir, $file));
|
||||||
} elsif (-f $fullFilePath) {
|
} 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 {
|
} else {
|
||||||
die("\"$fullFilePath\" is a strange file type, not handled!");
|
die("\"$fullFilePath\" is a strange file type, not handled!");
|
||||||
}
|
}
|
||||||
|
@ -197,10 +203,10 @@ while (my $rfp = readdir $topDH) {
|
||||||
make_path($numberedOutputDir, { mode => 0755 });
|
make_path($numberedOutputDir, { mode => 0755 });
|
||||||
if ($typeName =~ /email/i) {
|
if ($typeName =~ /email/i) {
|
||||||
ProcessMailDir($rfp, $typeDirName, $numberedOutputDir);
|
ProcessMailDir($rfp, $typeDirName, $numberedOutputDir);
|
||||||
move($typeDirName, $nativeOutputDirOneUp);
|
|
||||||
} else {
|
} else {
|
||||||
ProcessDocumentDirectory($rfp, $typeDirName, $numberedOutputDir);
|
ProcessDocumentDirectory($rfp, $typeDirName, $numberedOutputDir);
|
||||||
}
|
}
|
||||||
|
move($typeDirName, $nativeOutputDirOneUp);
|
||||||
}
|
}
|
||||||
closedir $bucketDH;
|
closedir $bucketDH;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue