taagangel
asked on
excluding a subdirectory in a perl script that uploads images to an ftp site
I am dealing with a perl script that runs on a cron to ftp images from one server to another via ftp. Currently the image directories are /listings/residential /listings/commcercial and so on... each of these directories has a subdirectory for thumbnails... as the script stands now, it ftps all the images and as a result the thumbnails end up overwriting the full size images... Can i easily add to the following code to exclude any subdirectory with the name 'thumb' or thumbnails?
here's the ftp portion of the code:
here's the ftp portion of the code:
open(IMG, "< $filelist") or die "$!";
while($file=<IMG>) {
chomp $file;
$rs = $ftp->put($file);
if($rs ne ''){
&log(sprintf("FTP PUT FILE: %s", $rs));
}else{
&log(sprintf("FTP PUT ERROR: %s", $file));
}
}
close(IMG);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks much!!!!! That did the trick! :-)
ASKER
Thank you! Another person posted a very similar answer before you did and that one worked. Wish I could give you some points though as yours looks like it would have worked as well.
No problem about the points - but you can split the points among multiple correct answers.
Open in new window