File-Stat-OO

 view release on metacpan or  search on metacpan

lib/File/Stat/OO.pm  view on Meta::CPAN

                )
            );
        } else {
            $self->$stat($file_stat[$counter++]);
        }
    }
}

sub owner {
    my $self = shift;
    return (getpwuid($self->uid))[0];
}

sub group {
    my $self = shift;
    return (getgrgid($self->gid))[0];
} 

=head2 use_datetime

If set, invocations of stat will record times as DateTime objects rather than

t/01-methods.t  view on Meta::CPAN


$obj->use_datetime(1);
$obj->stat($0);

foreach my $m (qw/atime ctime mtime/) {
    my $date_obj = $obj->$m;
    isa_ok($date_obj, 'DateTime');
}

unless ($^O =~ /Win/) {
    my $owner = (getpwuid($obj->uid))[0];
    my $group = (getgrgid($obj->gid))[0];
    is($owner, $obj->owner,  'Owner');
    is($group, $obj->group, 'Group');
}



( run in 0.264 second using v1.01-cache-2.11-cpan-8d75d55dd25 )