Issue #15664 has been updated by jeremyevans0 (Jeremy Evans).

File file-executable-doc.patch added

Unlike Unix, Windows doesn't support execute permissions separately. If the path is a regular file, Ruby currently uses file extensions to determine if a file is executable, and only considers the following extensions as executable: `.bat`, `.cmd`, `.com`, `.exe`.  See https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5598-L5602

I don't think this is fixable unless we want to make `File.executable?` an alias to `File.readable?` on Windows, and that would just result in the opposite issue, with `File.executable?` returning `true` for files that are just readable and not actually executable.

The documentation for `File.executable` and `File.executable_real?` does not currently reflect the issues on Windows.  Attached is a documentation patch to explain the behavior.  I plan to commit this in about a week unless I hear objections.

----------------------------------------
Bug #15664: File.executable returns incorrect results in Windows 10
https://bugs.ruby-lang.org/issues/15664#change-78447

* Author: BoldRabbit (Bold Rabbit)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.1
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Calling File.executable? <path> in Windows 10 return false for a file with execute permissions set.

---Files--------------------------------
RailsTest.PNG (108 KB)
FilePerm.PNG (3.99 KB)
file-executable-doc.patch (1.22 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>