Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confusing error when compiling Haskell program

On my WinXP (sp3) machine with the GHC Haskell Platform (2013.2.0.0), attempting to compile code results in the following error unless the file in question is contained within a subdirectory, i.e., not root ('C:\'):

Prelude> :l doubleMe.hs
[1 of 1] Compiling Main             ( doubleMe.hs, interpreted )
*** Exception: CreateDirectory ".": permission denied (Access is denied.)

Does anyone know if this is a bug? If so, it has persisted across multiple versions of GHC and I am beginning to suspect storing haskell code in subdirectories on Windows machines is simply a necessity. Is the error reproducible on *nix machines?

Thanks.

~Caitlin

like image 338
CaitlinG Avatar asked Nov 16 '13 07:11

CaitlinG


1 Answers

Just for posterity: the issue was GHCi attempting to create temporary files in whatever directory it happened to be running in. If this directory happened to be one with permissions issue (such as the root dir in Windows) then the error was thrown.

like image 170
sclv Avatar answered Nov 17 '22 05:11

sclv