Search code examples
haskellghciworking-directory

Change working directory in Haskell's GHCi to a path with spaces


I am running WinGHCi 1.0.6

I need to change working directory. Here is what I tried:

Prelude> :cd "C:/Temp Temp/Temp"

Returned error:

Exception: SetCurrentDirectory "\"C:/Temp Temp/Temp\"": invalid argument (The filename, directory name, or volume label syntax is incorrect.)

I also tried with single quote, but got the following error:

*** Exception: SetCurrentDirectory "'C:/Temp Temp/Temp'": invalid argument (The filename, directory name, or volume label syntax is incorrect.)

Any suggestions?


Solution

  • On my system, it appears that using quotes always fails, but using no quotes at all seems to work. (Even for paths with spaces.)

    Also seems to work both with forward slashes and backslashes. (Which isn't too surprising... Windows actually accepts either just fine.)