Skip to content

getCurrentDirectory should raise better error string when cwd doesn't exist #39

@thomie

Description

@thomie

@ezyang reports in https://ghc.haskell.org/trac/ghc/ticket/11280:

Run this script in a directory which no longer exists:

import System.Directory
main = getCurrentDirectory >>= putStrLn

Currently the error looks like:

ezyang@sabre:~/test$ ./test
bash: ./test: No such file or directory

It would be nicer to give a better message in this case.

Originally reported: ​haskell/cabal#2902

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions