Times.1.makeFolders.pl

From Ball State University Libraries Wiki

Jump to: navigation, search

Makes subdirectories called "scans" and "transcripts" in each directory under the "load" directory.

Use for the Muncie Times collection.

The Script

#!/usr/bin/perl
#

$root = ".";
$dir = $root . "/load";


opendir(THEDIR, $dir) or die "Unable to open directory: $!";
@dirs = readdir THEDIR;

foreach $file (@dirs) {
	if (-d "$dir\\$file" && $file ne "." && $file ne "..") {
		mkdir("$dir/$file/scans", 0777);
		mkdir("$dir/$file/transcripts", 0777);
	}
}

closedir THEDIR;
Personal tools