#!/usr/bin/env perl # Copyright 2007 Reinhard Kotucha # # This file is licensed under the GNU General Public License version 2 # or any later version. $^W=1; die "Argument missing.\n" unless (@ARGV); sub stat_pl { my $filename=shift; @stat=lstat "$filename"; print "File: \"$filename\"\n"; printf "%s\n","=" x(8 + length "$filename"); printf "Filesystem Device Number [dev]: %d\n", $stat[0]; printf "Inode Number [ino]: %d\n", $stat[1]; printf "Mode [mode]: %o\n", $stat[2] & 07777; printf "Number of Hard Links [nlinks]: %d\n", $stat[3]; printf "Numeric User ID [uid]: %d\n", $stat[4]; printf "Numeric Group ID [gid]: %d\n", $stat[5]; printf "Device Number [rdev]: %d\n", $stat[6]; printf "File Size [size]: %d\n", $stat[7]; printf "Time of last Access [atime]: %s\n", scalar (localtime $stat[8]); printf "Time of last Modification [mtime]: %s\n", scalar (localtime $stat[9]); printf "Time of Creation [ctime]: %s\n", scalar (localtime $stat[10]); # The following don't return anything on Windows. printf "Preferred Blocksize [blksize]: %s\n", $stat[11] if (defined $stat[11]); printf "Number of used Blocks [blocks]: %s\n", $stat[12] if (defined $stat[12]); } foreach my $file (@ARGV) { die "Can't stat $file: $!\n" unless (-e $file); stat_pl "$file"; print "\n" if (@ARGV>1); } ### Local Variables: ### perl-indent-level: 2 ### tab-width: 2 ### indent-tabs-mode: nil ### End: # vim:set tabstop=2 expandtab: #