-l
This commit is contained in:
parent
b6220c85c4
commit
93b13c84c5
1 changed files with 9 additions and 16 deletions
25
ls.rb
25
ls.rb
|
@ -83,22 +83,15 @@ def permission(file_stat)
|
|||
end
|
||||
|
||||
def file_type(file_stat)
|
||||
case file_stat.ftype
|
||||
when 'file'
|
||||
print '-'
|
||||
when 'directory'
|
||||
print 'd'
|
||||
when 'characterSpecial'
|
||||
print 'c'
|
||||
when 'blockSpecial'
|
||||
print 'b'
|
||||
when 'fifo'
|
||||
print 'p'
|
||||
when 'link'
|
||||
print 'l'
|
||||
when 'socket'
|
||||
print 's'
|
||||
end
|
||||
{
|
||||
'fifo' => 'p',
|
||||
'characterSpecial' => 'c',
|
||||
'directory' => 'd',
|
||||
'blockSpecial' => 'b',
|
||||
'file' => '-',
|
||||
'link' => 'l',
|
||||
'socket' => 's'
|
||||
}[file_stat]
|
||||
end
|
||||
|
||||
def file_size(filenames)
|
||||
|
|
Loading…
Reference in a new issue