App-GitFind
view release on metacpan or search on metacpan
lib/App/GitFind/FileStatLs.pm view on Meta::CPAN
The output B<includes> a trailing newline.
=cut
sub ls_stat {
my $fn = shift;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = lstat $fn;
my $dft = "%b %d %Y";
my $ud = getpwuid($uid);
my $gd = getgrgid($gid);
my $fm = format_mode($mode);
my $mt = strftime $dft,localtime $mtime;
my $link_to = (($mode & S_IFLNK) == S_IFLNK ? " -> @{[readlink $fn]}" : "");
my $fmt = "%10s %3d %7s %4s %12d %12s %-s%s\n";
return sprintf $fmt, $fm,$nlink,$ud,$gd,$size,$mt,$fn,$link_to;
}
=head2 stat_attr ($fn, $typ)
( run in 0.235 second using v1.01-cache-2.11-cpan-8d75d55dd25 )