Skip to content
instance method

File#chmod

(::int mode) -> (0 | nil)
file.chmod(mode_int) → 0

Changes permission bits on file to the bit pattern represented by mode_int. Actual effects are platform dependent; on Unix systems, see chmod(2) for details. Follows symbolic links. Also see File#lchmod.

Example
f = File.new("out", "w");
f.chmod(0644)   #=> 0
See also .chmod #birthtime #chown #atime also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0