1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: file_info.coretag,v 1.4 2007-03-30 23:40:54 pajamian Exp $
10 UserTag file-info Order name
11 UserTag file-info attrAlias file name
12 UserTag file-info addAttr
13 UserTag file-info Version $Revision: 1.4 $
14 UserTag file-info Routine <<EOR
18 $fn = "$Global::VendRoot/$fn"
21 $fn = "$Global::ConfDir/$fn"
24 $fn = "$Global::RunDir/$fn"
29 my $size = $stat[7] < 1024
31 : ( $stat[7] < 1024 * 1024
32 ? sprintf ("%.2fK", $stat[7] / 1024)
33 : sprintf ("%.2fM", $stat[7] / 1024 / 1024)
36 $opt->{flags} =~ s/\W//g;
37 my @flags = split //, $opt->{flags};
41 return join "\t", @flags;
50 return $Tag->time($Scratch->{mv_locale},{time => $stat[9], gmt => $opt->{gmt}},'%c');
52 $opt->{fmt} = '%f bytes, last modified %Y-%m-%d %H:%M:%S'
54 $opt->{fmt} =~ s/%f/$size/g;
55 $Tag->time($Scratch->{mv_locale},{time => $stat[9], gmt => $opt->{gmt}},$opt->{fmt});