ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:91822] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10
       [not found] <redmine.issue-15664.20190314003132@ruby-lang.org>
@ 2019-03-14  0:31 ` BoldRabbit
  2019-06-11 19:07 ` [ruby-core:93049] " merch-redmine
  2019-06-12  0:07 ` [ruby-core:93058] " nobu
  2 siblings, 0 replies; 3+ messages in thread
From: BoldRabbit @ 2019-03-14  0:31 UTC (permalink / raw)
  To: ruby-core

Issue #15664 has been reported by BoldRabbit (Bold Rabbit).

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

* 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)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:93049] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10
       [not found] <redmine.issue-15664.20190314003132@ruby-lang.org>
  2019-03-14  0:31 ` [ruby-core:91822] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10 BoldRabbit
@ 2019-06-11 19:07 ` merch-redmine
  2019-06-12  0:07 ` [ruby-core:93058] " nobu
  2 siblings, 0 replies; 3+ messages in thread
From: merch-redmine @ 2019-06-11 19:07 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:93058] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10
       [not found] <redmine.issue-15664.20190314003132@ruby-lang.org>
  2019-03-14  0:31 ` [ruby-core:91822] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10 BoldRabbit
  2019-06-11 19:07 ` [ruby-core:93049] " merch-redmine
@ 2019-06-12  0:07 ` nobu
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2019-06-12  0:07 UTC (permalink / raw)
  To: ruby-core

Issue #15664 has been updated by nobu (Nobuyoshi Nakada).


I agree on the documentation fix, but I guess that `Gem.bin_path` should return the proper stub file path in this case.

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

* 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-12  0:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15664.20190314003132@ruby-lang.org>
2019-03-14  0:31 ` [ruby-core:91822] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10 BoldRabbit
2019-06-11 19:07 ` [ruby-core:93049] " merch-redmine
2019-06-12  0:07 ` [ruby-core:93058] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).