Open jwoertink opened 1 year ago
0o777
is the octal form of decimal 511
, so it's technically correct, but seems the API docs are resolving it to its decimal form versus retaining the octal form.
A trivial solution would be to use File::Permissions::All
.
Visiting the docs for Dir.mkdir_p https://crystal-lang.org/api/1.8.2/Dir.html#mkdir_p%28path%3APath%7CString%2Cmode%3D511%29%3ANil-class-method
I noticed it shows a default mode of
511
Although it says the default is
0o777
. If we visit the source, it's correct:https://github.com/crystal-lang/crystal/blob/1a43461bb87d8f27576b1695091cc83b94ecdcb1/src/dir.cr#L277-L284
So somehow the docs read
0o777
and convert it to511
? :thinking: