Skip to content

File.directory? returns false on macOS M1 for a directory #6813

@rykov

Description

@rykov

Environment Information

  • jruby 9.2.19.0 (2.5.8) 2021-06-15 55810c5 OpenJDK 64-Bit Server VM 11.0.12+0 on 11.0.12+0 +jit [darwin-aarch64]
  • Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64

Also tested on:

  • jruby 9.2.20.0-SNAPSHOT (2.5.8) 2021-09-02 a7e20fa OpenJDK 64-Bit Server VM 17+0 on 17+0 +jit [darwin-aarch64]

Expected Behavior

  • File.stat(directory).directory? should return true
  • Here's the correct functionality on Linux:
$ uname -mrsv
Linux 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 aarch64
$ jruby -v
jruby 9.2.19.0 (2.5.8) 2021-06-15 55810c552b OpenJDK 64-Bit Server VM 16.0.2+7-67 on 16.0.2+7-67 +jit [linux-aarch64]
$ jruby -e 'puts File.stat(".").directory?'
true

Actual Behavior

  • File.stat(directory).directory? returns false
$ uname -mrsv
Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64
$ jruby -v
jruby 9.2.19.0 (2.5.8) 2021-06-15 55810c552b OpenJDK 64-Bit Server VM 11.0.12+0 on 11.0.12+0 +jit [darwin-aarch64]
$ jruby -e 'puts File.stat(".").directory?'
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions