Cory Watson wrote:
> Is this the intended behavior or should that if() in T::Provider check
> for an undef on the stat?

Hi Cory, 

That's definately not the intended behaviour.  It should check for 
undef on the stat.

However, we've just replaced that particular bit of code with a call
to a new _mtime() method:

        if ($compiled && -f $compiled 
-            && (stat($name))[9] <= (stat($compiled))[9]) {        # v2.14
+            && $self->_mtime($name) <= (stat($compiled))[9]) {    # v2.14a

See: http://tt2.org/pipermail/templates-cvs/2006-February/002191.html

So I think I'll adapt that slightly to allow us to code the undef
check inside the _mtime() method (which might be better named "_modified()")

        if ($compiled && -f $compiled 
            && ! $self->_modified($name, (stat($compiled))[9])) {

When called with 2 args, _modified($name, $time) returns true if $name
has been modified since $time.  If the stat() on $name returns undef
(i.e. the file has been deleted), then it returns 1 and the compiled
file is bypassed.  When called with 1 arg it returns the modification 
time as before.

Anyone care to code some tests?

A


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to