.rb
File::Stat.new(file).mode.to_s(8)
# => "100444"
そのまま File::Stat#modeを出力すると整数を返されて何がなんだかわからなくなるので to_s(8)で8進数に変換して読みましょう。
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
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
Go to list of users who liked