From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 9E8C61F462 for ; Tue, 11 Jun 2019 19:07:46 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 9AD48120925; Wed, 12 Jun 2019 04:07:40 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id BF895120A10 for ; Wed, 12 Jun 2019 04:07:38 +0900 (JST) Received: by filter0076p3las1.sendgrid.net with SMTP id filter0076p3las1-27865-5CFFFBFB-17 2019-06-11 19:07:39.429576088 +0000 UTC m=+610683.381775002 Received: from herokuapp.com (unknown [107.20.11.70]) by ismtpd0038p1iad2.sendgrid.net (SG) with ESMTP id zVaPhQo2Qpu-GE_Vvt1r-A for ; Tue, 11 Jun 2019 19:07:39.289 +0000 (UTC) Date: Tue, 11 Jun 2019 19:07:39 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68527 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15664 X-Redmine-Issue-Author: BoldRabbit X-Redmine-Sender: jeremyevans0 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BIrr3XKtFmur6aXFbfIWBSO89Hw2P2ZLQsHIXJZ?= =?us-ascii?Q?DLJhIIqiII6KmFmLZeqBHypM3hd=2FwD=2FMePPshes?= =?us-ascii?Q?hzAbPuCcjR8KhuWOHvMHV2DnJSSGbz6Wt7T6f1Y?= =?us-ascii?Q?IT2l8IU9SQfbY2BhLHuaaiE3VCBuzyQ=2FOBQ=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 93049 Subject: [ruby-core:93049] [Ruby trunk Bug#15664] File.executable returns incorrect results in Windows 10 X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "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? 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/