flieckster has asked for the wisdom of the Perl Monks concerning the following question:
push (@finalcount, @fileslist); $filecount = @finalcount;
#!/usr/bin/env perl use File::Find; use File::Copy; use Mail::Sender; use Net::SMTP; use File::Basename; use File::Slurp; use POSIX qw(strftime); my $date = strftime("%m-%d-%y",localtime); my $time = strftime("%I:%M:%S",localtime); chomp($myname = `id -un`); BEGIN { unshift @INC, '/usr/bin/lib' } my $findme = "/Volumes/photorepos/Perl/HAL/WorkLoad/"; my $count = "/Users/$myname/Desktop/count.txt"; my $log = "> $count"; chdir($findme) or warn "/Volumes/photorepos/Perl/HAL/WorkLoad/ $!"; #################################### #Open the file made above and the list of files to search for #################################### print "$date $time Reporting Running\n"; my $filename = 'directorys.txt'; # my $currentfiles = '/Users/flieckb/Desktop/count.txt'; open(my $fh, '<:encoding(UTF-8)', $filename) or die "Could not open file '$filename' $!"; open FILE, "$log" or warn $!; while (my $row = <$fh>) { chomp $row; foreach ($row) { chdir ($row); (@fileslist) = glob "*"; if ( -e "Thumbs.db") { unlink ("Thumbs.db") or print "thumbs.db $!\n"; } $filecount = @fileslist; if (@fileslist > 0) { # if (-d "$row"){ print FILE "$filecount\n"; push (@finalcount, @fileslist); $filecount = @finalcount; # print "total $finalcount\n"; # foreach $file (@fileslist) { # print("$file\n"); # } } # } else { # print "$row\t0\n" } } } close ; # sub us { # system "/Volumes/photorepos/Perl/HAL/WorkLoad/CurrentEmailSender.pl" +; # } # us();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pushing file counts for adding
by Corion (Patriarch) on Mar 21, 2016 at 14:19 UTC | |
by flieckster (Scribe) on Mar 21, 2016 at 15:18 UTC | |
by Corion (Patriarch) on Mar 21, 2016 at 15:29 UTC | |
by flieckster (Scribe) on Mar 21, 2016 at 17:14 UTC | |
by GotToBTru (Prior) on Mar 21, 2016 at 18:47 UTC | |
|
Re: pushing file counts for adding
by TorontoJim (Beadle) on Mar 21, 2016 at 22:48 UTC | |
by Anonymous Monk on Mar 21, 2016 at 23:01 UTC | |
by TorontoJim (Beadle) on Mar 21, 2016 at 23:11 UTC | |
by Anonymous Monk on Mar 21, 2016 at 23:25 UTC | |
by TorontoJim (Beadle) on Mar 22, 2016 at 10:22 UTC | |
| |
by TorontoJim (Beadle) on Mar 21, 2016 at 22:50 UTC |