#!/usr/bin/perl

$homedir="/testfs0/t";
$basedir="$homedir/base";

`mkdir -p $basedir`;

$YYYY=2002;
$MM=12;
$days=31;
$vars=59;
$hours=2500;
$workers=40;
$files=100;

chdir("$basedir");
mkdir("$YYYY-$MM");
chdir("$YYYY-$MM");

$day=1;

while ( $day <= $days ) {
	if ( $day <= 10 ) {
		mkdir("0$day");
                chdir("0$day");
                $var=1;
                while ( $var <= $vars ) {
                        mkdir("var$var");
                        chdir("var$var");
                        $hour=100;
                        while ( $hour <= $hours ) {
                                mkdir("$hour");
                                chdir("$hour");
                                $worker=1;
                                while ( $worker <= $workers ) {
					mkdir("DE$worker");
                                        chdir("DE$worker");
                                        $file=1;
                                        while ( $file <= $files ) {
                                                open(OUTFILE,">file$file");
						close(OUTFILE);
                                                $file=$file+1;
                                        }
                                        $worker=$worker+1;
                                        chdir("..");
                                }
                                chdir("..");
                                $hour=$hour+100;
                        }
                        chdir("..");
                        $var=$var+1;
                }
                chdir("..");
	} else {
		last;
	}
	$day=$day+1;
}
