|
@@ -3,7 +3,7 @@ use file::File;
|
|
|
use std::io;
|
|
use std::io;
|
|
|
|
|
|
|
|
pub enum FileType {
|
|
pub enum FileType {
|
|
|
- Normal, Directory, Executable, Immediate, Compiled, Symlink,
|
|
|
|
|
|
|
+ Normal, Directory, Executable, Immediate, Compiled, Symlink, Special,
|
|
|
Image, Video, Music, Lossless, Compressed, Document, Temp, Crypto,
|
|
Image, Video, Music, Lossless, Compressed, Document, Temp, Crypto,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -46,6 +46,7 @@ impl FileType {
|
|
|
Normal => Plain,
|
|
Normal => Plain,
|
|
|
Directory => Blue.bold(),
|
|
Directory => Blue.bold(),
|
|
|
Symlink => Cyan.normal(),
|
|
Symlink => Cyan.normal(),
|
|
|
|
|
+ Special => Yellow.normal(),
|
|
|
Executable => Green.bold(),
|
|
Executable => Green.bold(),
|
|
|
Image => Fixed(133).normal(),
|
|
Image => Fixed(133).normal(),
|
|
|
Video => Fixed(135).normal(),
|
|
Video => Fixed(135).normal(),
|
|
@@ -73,6 +74,9 @@ impl<'a> HasType for File<'a> {
|
|
|
else if self.stat.kind == io::TypeSymlink {
|
|
else if self.stat.kind == io::TypeSymlink {
|
|
|
return Symlink;
|
|
return Symlink;
|
|
|
}
|
|
}
|
|
|
|
|
+ else if self.stat.kind == io::TypeBlockSpecial || self.stat.kind == io::TypeNamedPipe || self.stat.kind == io::TypeUnknown {
|
|
|
|
|
+ return Special;
|
|
|
|
|
+ }
|
|
|
else if self.stat.perm.contains(io::UserExecute) {
|
|
else if self.stat.perm.contains(io::UserExecute) {
|
|
|
return Executable;
|
|
return Executable;
|
|
|
}
|
|
}
|