Project

General

Profile

Actions

Feature #7288

closed

Documentation missing: FileUtils.chmod "+X", "directory"

Added by joerg.herzinger (Jörg Herzinger) over 11 years ago. Updated over 11 years ago.

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

Description

Documentation for chmods "X" (uppercase) feature is missing. This sets the execute bit on directories but not on files. Tested on my Ubuntu machine it works although not documented.
Reproducable like this:

[irb]
require 'fileutils'
FileUtils.cd "/tmp";FileUtils.touch "testfile";FileUtils.mkdir "testdir"

FileUtils.chmod "-x", "testfile"; FileUtils.chmod "-x", "testdir"
File.executable? "testdir" => false
File.executable? "testfile" => false

FileUtils.chmod "+X", "testfile"; FileUtils.chmod "+X", "testdir"
File.executable? "testdir" => true
File.executable? "testfile" => false
[/irb]

From chmods man page:
... execute (or search for directories) (x), execute/search only if the file is a directory or already has execute permission for some user (X) ...

Actions

Also available in: Atom PDF

Like0
Like0Like0