-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfileinfo
executable file
·28 lines (26 loc) · 1.08 KB
/
fileinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/perl --
# fileinfo (PERL script) -- prints time & inode info about a file
#
# Written 31 Dec 2002
if ($#ARGV + 1 >= 1)
{
for ($argindex = 0; $argindex <= $#ARGV; ++$argindex)
{
if ((@all_info = stat( $ARGV[$argindex] )) == undef)
{
print STDERR ( "cannot stat $ARGV[$argindex]: $!\n" );
}
else
{
($info{'dev'}, $info{'ino'}, $info{'mode'}, $info{'nlink'}, $info{'uid'}, $info{'gid'}, $info{'rdev'}, $info{'size'}, $info{'atime'}, $info{'mtime'}, $info{'ctime'}, $info{'blksize'}, $info{'blocks'}) = @all_info;
$info{'name'} = $ARGV[$argindex];
printf( "%s \t%o %d bytes (%s)\n",
$info{'name'}, $info{'mode'}, $info{'size'},
"$info{'dev'}:$info{'ino'}" );
# I think the $bf forces the output into string context
print( ($bf = localtime( $info{'atime'} )) . " " .
($bf = localtime( $info{'mtime'})) . " " .
($bf = localtime( $info{'ctime'} )) . "\n" );
}
}
}