=================================================================== RCS file: /cvs/misc/strmode/perl_strmode.pl,v retrieving revision 1.2 retrieving revision 1.5 diff -u -r1.2 -r1.5 --- misc/strmode/perl_strmode.pl 2011/03/27 22:26:33 1.2 +++ misc/strmode/perl_strmode.pl 2011/03/28 03:38:52 1.5 @@ -1,6 +1,6 @@ #!/usr/bin/perl -T -# $AFresh1: perl_strmode.pl,v 1.1.1.1 2011/03/27 20:54:35 andrew Exp $ +# $AFresh1: perl_strmode.pl,v 1.4 2011/03/28 02:37:48 andrew Exp $ # # Copyright (c) 2011 Andrew Fresh # Copyright (c) 1990 The Regents of the University of California. @@ -52,11 +52,9 @@ when (S_IFREG) { $p .= '-' } # regular when (S_IFLNK) { $p .= 'l' } # symbolic link when (S_IFSOCK) { $p .= 's' } # socket - - #ifdef S_IFIFO XXX How important is this ifdef? +#ifdef S_IFIFO XXX How important is this? Is S_IFIFO ever not set? when (S_IFIFO) { $p .= 'p' } # fifo - - #endif +#endif default { $p .= '?' } # unknown } @@ -98,9 +96,9 @@ @files = '.' unless @files; foreach my $file (@files) { - next unless -e $file; my ( $mode, $nlink, $uid, $gid, $size, $mtime ) - = ( stat(_) )[ 2 .. 5, 7, 9 ]; + = ( lstat($file) )[ 2 .. 5, 7, 9 ] + or next; my $time = localtime($mtime); $time =~ s/^\w+\s+//;