Skip to content

'/' works as a valid path but children don't (under windows) #1653

@walkeriniraq

Description

@walkeriniraq
>> require 'pathname'
>> Pathname.new('/').exist?
=> true
>> Pathname.new('/').children.first.exist?
=> false
>> Pathname.new('C:\\').children.first.exist?
=> true

This is maybe a little obscure but Java considers C:\ to be equivalent to *nix root. And pathname seems to as well, but anything under root isn't recognized. Having this problem in the File class as well, just not as pretty to demo.

Tested under 1.7.12 and 1.7.9 with Java 8 and Win7. Problem exists in all compatibility modes as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions