Reputation: 2015
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
Upvotes: 12
Views: 596
Reputation: 38891
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.
Upvotes: 1
Reputation: 103
I'd recommend checking the permissions for the files you're attempting to create. If you're attempting to put them in a restricted area, you'll need additional permissions to do so.
Upvotes: 0