This commit is contained in:
Rikuoh Tsujitani 2024-06-12 10:45:58 +09:00
parent 489e1f66ba
commit 021bd4f5ad

10
ls.rb
View file

@ -64,10 +64,12 @@ def output_file_datails(filenames)
end
def owner_info(file_stat, filenames)
print " #{file_stat.nlink}"
print " #{Etc.getpwuid(file_stat.uid).name}"
print " #{Etc.getgrgid(file_stat.gid).name}"
" #{file_stat.size}".rjust(max_filename_length(filenames))
[
file_stat.nlink.to_s.prepend(' '),
Etc.getpwuid(file_stat.uid).name,
Etc.getgrgid(file_stat.gid).name,
file_stat.size.to_s.rjust(max_filename_length(filenames))
].join(' ')
end
def symbolic(filenames)