Method: FileUtils#user_mask

Defined in:
lib/fileutils.rb

#user_mask(target) ⇒ Object

:nodoc:

[View source]

1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
# File 'lib/fileutils.rb', line 1643

def user_mask(target)  #:nodoc:
  target.each_char.inject(0) do |mask, chr|
    case chr
    when "u"
      mask | 04700
    when "g"
      mask | 02070
    when "o"
      mask | 01007
    when "a"
      mask | 07777
    else
      raise ArgumentError, "invalid 'who' symbol in file mode: #{chr}"
    end
  end
end