Hi
I'm trying to look through a series of directories in A folder, lets just call it A:
for example:
A/1
A/2
A/3
Etc and I wish to move the files in the folder if they are bigger than a certain size into a structure like below:
A/TooBig/1
A/TooSmall/1
A/TooBig/2
A/TooSmall/2
A/TooBig/3
A/TooSmall/3
I also need it to write the filename as it goes into the TooBig folder. I have something like this but it does'nt seem to work.. Any ideas please?
open (TooBig, "> $TooBigOutput") or die;
my $dir = 'C:/temp/';
opendir(DIR, $dir) or die $!;
while (my $file = readdir(DIR)) {
if ( $filesize gt 0)
{
move("c:/temp", "c:temp/Big");
print TooBig "$filesize";
}
else {
move("c:/temp", "c:temp/Small");
}
}
closedir(DIR);
exit 0;