Skip to content

findFile edges case with absolute paths on Windows #72

@jmitchell

Description

@jmitchell

The examples below where findFile returns Nothing are surprising, and if possible I think they should return the obvious path.

Prelude> import System.Directory
Prelude System.Directory> doesFileExist "C:\\tmp\\Test.hs"
True
Prelude System.Directory> findFile [] "C:\\tmp\\Test.hs"
Nothing
Prelude System.Directory> findFile ["C:\\"] "tmp\\Test.hs"
Just "C:\\tmp\\Test.hs"
Prelude System.Directory> findFile [] "\\tmp\\Test.hs"
Nothing
Prelude System.Directory> findFile ["\\"] "tmp\\Test.hs"
Just "\\tmp\\Test.hs"
Prelude System.Directory> setCurrentDirectory "C:\\tmp"
Prelude System.Directory> findFile ["."] "Test.hs"
Just ".\\Test.hs"

Metadata

Metadata

Assignees

Labels

type: a-bugThe described behavior is not working as intended.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions