method
mode_mask
ruby latest stable - Class:
FileUtils
mode_mask(mode, path)public
No documentation available.
# File lib/fileutils.rb, line 885
def mode_mask(mode, path) #:nodoc:
mask = 0
mode.each_byte do |byte_chr|
case byte_chr.chr
when "r"
mask |= 0444
when "w"
mask |= 0222
when "x"
mask |= 0111
when "X"
mask |= 0111 if FileTest::directory? path
when "s"
mask |= 06000
when "t"
mask |= 01000
end
end
mask
end