#!/usr/bin/perl

if ($#ARGV != 0) {
	print "Usage: enum.pl <dir>\n";
	exit 1;
}

my $testdir = $ARGV[0];
my $i;
my $dir;
my $res;
my ($first);

chdir "$testdir";

$i = 1;
until ($i == 500) {
	$dir = "dir" . $i;
	$res = ".rsrc" . "/" . $dir;
	stat ($dir) || die "stat $dir failed";
	if (stat ($res)) {
		open (FILE, "<$res") || die "open $res failed";
			read (FILE, $first, 64);
		close (FILE);
	} else {
		print "stat $res failed";
		exit 1;
	}
	$i++;
}