[Haskell-beginners] doesFileExist cannot get ~/blah_blah right

Kim-Ee Yeoh ky3 at atamo.com
Tue Apr 9 01:20:57 CEST 2013


On Tue, Apr 9, 2013 at 6:04 AM, Erlend Hamberg <ehamberg at gmail.com> wrote:
> When you type “~/blah_blah” in your shell, the *shell* will expand “~” to
> your home directory, so when you pass “~/foo” to a program, that program
> never sees “~/foo”, but “/home/user/foo”. In other words, “~/blah_blah”
> probably does *not* exist.

To expand on this, doesFileExist is a thin shim over a low-level OS call.

On the other hand, tilde expansion happens at the shell (application) level.

-- Kim-Ee



More information about the Beginners mailing list