I am trying to use the :mode option in FileUtils.mkdir_p . However, I get unexpected results with Ruby 2.1.0.
require 'fileutils' FileUtils.mkdir_p '/this/is/my/full/path/tmp', :mode => 2750
Result:
d-wSrwxrwT 2 myuid users 4096 Mar 24 10:14 tmp
However, if I just call shell commands with backticks, I get the desired result:
`mkdir /this/is/my/full/path/tmp && chmod 2750 /this/is/my/full/path/tmp`
Result:
drwxr-s--- 2 myuid users 4096 Mar 24 10:16 tmp
How to create a directory with the required permissions without using shell commands?
source share