Project

General

Profile

Actions

Feature #2190

closed

FileUtils::chmod - allow symbolic mode

Added by sunaku (Suraj Kurapati) about 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:26029]

Description

=begin
Hello,

I request that FileUtils::chmod() and FileUtils::chmod_R() accept
symbolic modes, which are strings like "u+x,g-w,o=" (see "symbolic
mode" in man chmod for details), in addition to the numeric modes
they currently accept.

If my request is fulfilled, the following would be equivalent:

FileUtils::chmod(0712, "file.txt")

FileUtils::chmod("u=rwx,g=x,o=w", "file.txt")

In addition, symbolic modes would allow delta/patch changes:

FileUtils::chmod("g+w", "file.txt")

This is not so easy with numeric modes, because you must
first read the current mode, apply your delta/patch mode
using a bitwise OR operation, and finally apply the new
numeric mode using FileUtils::chmod().

Thanks for your consideration.
=end


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0