#!/usr/bin/perl if( $#ARGV < 0 ) { print "please enter a filename > "; $filename = ; } else { $filename = shift; } chomp( $filename ); if( -e $filename ) { @stats = stat( $filename ); print "---------------------------------------------------------------\n"; print "Device number of filesystem: $stats[0]\n"; print "Inode number: $stats[1]\n"; print "File mode (type and permissions): $stats[2]\n"; print "Number of (hard) links to the file: $stats[3]\n"; print "Numeric user ID of file's owner: $stats[4]\n"; print "Numeric group ID of file's owner: $stats[5]\n"; print "The device identifier (special files only): $stats[6]\n"; print "Total size of file, in bytes: $stats[7]\n"; print "Last access time since the epoch: $stats[8]\n"; print "Last modify time since the epoch: $stats[9]\n"; print "Inode change time (NOT creation time) since the epoch:$stats[10]\n"; print "Preferred blocksize for file system I/O: $stats[11]\n"; print "Actual number of blocks allocated: $stats[12]\n"; print "----------------------------------------------------------------\n"; } else { print "couldn't open $filename: $!\n"; }