diff options
author | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:34 +0000 |
---|---|---|
committer | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:34 +0000 |
commit | c1363a95102dd70909a9a24c4decaaf4a18bfd53 (patch) | |
tree | fc06efcade69c48f122027291af496f64eb87609 /bin/psycamp | |
parent | e4422c244d5187c7c7b3e9a2d986f041a3fc8a7a (diff) | |
download | perlpsyc-c1363a95102dd70909a9a24c4decaaf4a18bfd53.tar.gz perlpsyc-c1363a95102dd70909a9a24c4decaaf4a18bfd53.zip |
psycamp: show the number of hardlinks a file has
Diffstat (limited to 'bin/psycamp')
-rwxr-xr-x | bin/psycamp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/psycamp b/bin/psycamp index c996173..770325b 100755 --- a/bin/psycamp +++ b/bin/psycamp | |||
@@ -1178,11 +1178,19 @@ sub ginparse { | |||
1178 | if $? != 256; | 1178 | if $? != 256; |
1179 | } | 1179 | } |
1180 | my $nf = $CurrentFile; | 1180 | my $nf = $CurrentFile; |
1181 | $nf =~ s/\.(\S+)$//i; | 1181 | $nf =~ s/\.([^\.]+)$//i; |
1182 | $codec = $1 unless $codec; | 1182 | $codec = $1 unless $codec; |
1183 | $PrintCurrentFile = $codec? "<$codec> $CurrentSize " | 1183 | my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, |
1184 | : $CurrentSize .' '; | 1184 | $atime,$mtime,$ctime,$blksize,$blocks) |
1185 | $PrintCurrentFile .= &stringtail($nf, $TWIDTH | 1185 | = stat($CurrentFile); |
1186 | $PrintCurrentFile = $nlink>1? | ||
1187 | YELLOW. $CurrentSize .BLUE.'#'. $nlink .RESET: | ||
1188 | YELLOW. $CurrentSize .RESET; | ||
1189 | # consider color codes: | ||
1190 | my $twidth = $nlink>1? $TWIDTH + 3*4 : $TWIDTH + 2*4; | ||
1191 | $PrintCurrentFile = $codec? | ||
1192 | "<$codec> $PrintCurrentFile ": $PrintCurrentFile .' '; | ||
1193 | $PrintCurrentFile .= &stringtail($nf, $twidth | ||
1186 | -length($PrintCurrentFile) ); | 1194 | -length($PrintCurrentFile) ); |
1187 | print "\r$PrintCurrentFile\n"; | 1195 | print "\r$PrintCurrentFile\n"; |
1188 | $CurrentInfo = "$TC -> [$I{duration}] $I{frequency} Hz at $I{bitrate} kbps with $I{channels} channels"; | 1196 | $CurrentInfo = "$TC -> [$I{duration}] $I{frequency} Hz at $I{bitrate} kbps with $I{channels} channels"; |