X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ffiles%2Fsumming_dir.pl;h=82f4d29e0397fee5d36bc0af71874a0f6fdaa1f6;hb=0aa30bc7344648da680d1e202a01cd3eb343a8ab;hp=4aa2031cd46b3b0ebe24eba3c5c09427a2345449;hpb=0367a8400255fcd00c76c80c146b764a2a995f6f;p=feisty_meow.git diff --git a/scripts/files/summing_dir.pl b/scripts/files/summing_dir.pl index 4aa2031c..82f4d29e 100644 --- a/scripts/files/summing_dir.pl +++ b/scripts/files/summing_dir.pl @@ -20,7 +20,7 @@ require "filename_helper.pl"; -use Env qw($TMP $color_add $TERM); +use Env qw($TMP $color_add $ls_dot_add $TERM); local($chewed_line) = ""; local(@arg_list); @@ -37,6 +37,8 @@ if ($#ARGV < 0) { @arg_list = &glob_list(@ARGV); } +# add parameters to our chewed_line, but skip items if they are flags we don't +# implement. foreach $dir (@arg_list) { if ($dir eq "-al") { next; } # skip ls directives. if ($dir eq "-l") { next; } # skip ls directives. @@ -56,8 +58,8 @@ chop($temp_file); # drop the main payload, the list of directory info, but also save that # info to a file for analysis. -system("ls -HhlF $color_add $chewed_line"); -system("ls -HhlF $color_add $chewed_line > $temp_file"); +system("ls -HhlF $ls_dot_add $color_add $chewed_line"); +system("ls -HhlF $ls_dot_add $color_add $chewed_line > $temp_file"); # the color_add variable, if defined, will have flags for setting the # directory listing color scheme. @@ -94,9 +96,19 @@ unlink($temp_file); # clean up. local($total)=int($lengths); local($kbytes)=int($total / 102.4) / 10; local($mbytes)=int($kbytes / 102.4) / 10; +local($gbytes)=int($mbytes / 102.4) / 10; print "\n"; -print "These files occupy $total bytes ($kbytes KB / $mbytes MB).\n"; +# print a fancy listing showing bytes at least, but only showing mb and gb if appropriate. +print "These files occupy $total bytes ($kbytes KB"; +if ($mbytes ne 0) { + print " / $mbytes MB"; +} +if ($gbytes ne 0) { + print " / $gbytes GB"; +} +print ").\n"; + print "Overall Drive Usage (megs):\n"; system("df -m $chewed_line >$temp_file");