in reply to Date checking files for a cache
My first thought is why do a '-e' if you are going to do a '-s' too? -s returns false on non-existing files. It has to exist to have a size.
Do you have an oddball filesystem? Old version of perl? Is the file a symlink?
Can you rewrite the code like this?
{ my $s= -s $file; my $m= -M $file; if ($s and $m > 3) { &sendfile($file) # does it return a checkable value? } else { die "file: $file\nsize: $s, time: $M\n"; } }
Or if you can, debug mode is your friend. The code you sent "WorksForMe", with or without the '-e'.
--
$you = new YOU;
honk() if $you->love(perl)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Date checking files for a cache
by strredwolf (Chaplain) on Sep 24, 2000 at 23:05 UTC |