FireyIce01 has asked for the wisdom of the Perl Monks concerning the following question:
The problem is encountered here:#!/usr/bin/perl use strict; use File::stat; use Date::Manip; # This is a program that is intended to allow FEP operators # a tool that will facilitate in monitoring incoming transmissions # and preprocessor logs. #------------------- Define Subroutines ------------------# # # # Main is a subroutine simply written for flow control sub Main { my $corp = $_[0]; print "Input:\n"; farmInput($corp,'input'); print "Save:\n"; farmInput($corp, 'input/save'); print "Failed:\n"; farmInput($corp, 'input/failed'); print "Log:\n"; farmInput($corp, 'log'); } # end Main # This subroutine takes 2 input variables, the corp (or any text you w +ant to find) # and the path sub farmInput { my($corp, $finalPath) = ($_[0], $_[1]); my $path = "/usr/local/farm/*/*/$finalPath/*$corp*"; my @farms = glob($path); foreach my $farm (@farms) { my $s = stat($farm); printf "%s\nAge[%s] size[%d]\n", $farm, ParseDateString("epoch".$s +->mtime()), $s->size(); # the above line does the same thing as the next 4 commented lines # printf "%s: Age [%s], size[%s]\n", # $farm, # DateCalc( "Jan 1, 1970 00:00:00 GMT",$s->mtime() ), # $s->size(); } # end of foreach statement } # end farmInput #------------------- End Subroutines ---------------------# print "What corp are you looking for? " ; chomp(my $whatWeWant = <STDIN>); Main($whatWeWant);
</readmore> <p> using my perl script I get: </p> <code> /usr/local/farm/vstrm/vsafp/input/IVS86095.01172005.C01.ITDVS.STMTS.10 +0105.DAT01 Age[2005011723:54:53] size[-1]
when ls -ltr gives me:
-rw-rw-r-- 1 cdusr001 prod 29116399616 Jan 17 23:55 IVS86095.011 +72005.C01.ITDVS.STMTS.100105.DAT01
Notice, the file is also still coming in... I don't know if that has anything to do with the issue, but this is usually a 32 gig file... soo...
How would I go about writing this so that it shows the filesize properly?
Readmore tags added by davido per consideration vote of 3/35/0.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Large Files and glob/stat
by BrowserUk (Patriarch) on Jan 18, 2005 at 09:12 UTC | |
|
Re: Large Files and glob/stat
by Zaxo (Archbishop) on Jan 18, 2005 at 08:59 UTC | |
|
Re: Large Files and glob/stat
by chb (Deacon) on Jan 18, 2005 at 08:40 UTC | |
by FireyIce01 (Novice) on Jan 18, 2005 at 08:57 UTC | |
by chb (Deacon) on Jan 18, 2005 at 09:16 UTC |