RE: [Perl-unix-users] Re: File age

2002-09-05 Thread Allegakoen, Justin Devanandan
---8<--- - Using my $filename = "$test"; my $mtime = (stat $filename)[9]; # or ctime is 10 my $time = time; # broke time out to print my $age = int (($time - $mtime) / 86400); # did int to drop fraction print "time=$time, mti

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread jna
Ah hah! I removed the file::stat and it worked like a charm! Awesome! Thanks, John > [EMAIL PROTECTED] wrote: > > Using > > > > my $filename = "$test"; > > my $mtime = (stat $filename)[9]; # or ctime is 10 > > my $time = time; # broke time out to print > > my $age = int (($time - $mtime) / 86400

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Using > > my $filename = "$test"; > my $mtime = (stat $filename)[9]; # or ctime is 10 > my $time = time; # broke time out to print > my $age = int (($time - $mtime) / 86400); # did int to drop fraction > print "time=$time, mtime=$mtime, age=$age\n"; > > I get the follo

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread jna
Using my $filename = "$test"; my $mtime = (stat $filename)[9]; # or ctime is 10 my $time = time; # broke time out to print my $age = int (($time - $mtime) / 86400); # did int to drop fraction print "time=$time, mtime=$mtime, age=$age\n"; I get the following results: time=1031216545 mtime= age=11

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Well its not much different than what was posted below, here it is : > > my $ctime = (stat $test)[10]; # or mtime is 9 > my $age = (time - $ctime) / 86400; > > The file date is Sep 2 07:46 and this code tells me it is 11935.3388425926 > days old!? The display time is

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread jna
Well its not much different than what was posted below, here it is : my $ctime = (stat $test)[10]; # or mtime is 9 my $age = (time - $ctime) / 86400; The file date is Sep 2 07:46 and this code tells me it is 11935.3388425926 days old!? Thanks, John > > Hello, > > Thanks for the code below. W

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Hello, > > Thanks for the code below. When I implement this I still get a number like > 11935.3388425926 but the file is not 11935 days old its date is Sep 2 07:46 > Am I missing something here? BTW I switched to mtime [9] as I want the > creation of last modified not

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread jna
Hello, Thanks for the code below. When I implement this I still get a number like 11935.3388425926 but the file is not 11935 days old its date is Sep 2 07:46 Am I missing something here? BTW I switched to mtime [9] as I want the creation of last modified not accessed. Thanks, John > [EMAIL P

[Perl-unix-users] Re: File age

2002-09-04 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Hello, > > I am looking to find out the age of a file in days, what is the best way to > do this using perl and maby file:stat or something? I have tried but get > some outrageous number in the millions!? Untested: my $ctime = (stat $filename)[10]; # or mtime