File::Stat.new(file).mode.to_s(8)
# => "100444"
そのまま File::Stat#mode
を出力すると整数を返されて何がなんだかわからなくなるので to_s(8)
で8進数に変換して読みましょう。
More than 5 years have passed since last update.
File::Stat.new(file).mode.to_s(8)
# => "100444"
そのまま File::Stat#mode
を出力すると整数を返されて何がなんだかわからなくなるので to_s(8)
で8進数に変換して読みましょう。
Register as a new user and use Qiita more conveniently