简体   繁体   English

编译Haskell程序时出错

[英]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, ie, not root ('C:\\'): 在具有GHC Haskell平台(2013.2.0.0)的WinXP(sp3)机器上,尝试编译代码会导致以下错误,除非有问题的文件包含在子目录中,即不是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. 如果是这样,它已经持续存在多个版本的GHC,我开始怀疑在Windows机器上的子目录中存储haskell代码是必要的。 Is the error reproducible on *nix machines? 错误是否可以在* nix机器上重现?

Thanks. 谢谢。

~Caitlin 〜凯特琳

后代:问题是GHCi试图在它碰巧运行的任何目录中创建临时文件。如果这个目录恰好是一个有权限问题的目录(例如Windows中的根目录),那么就会抛出错误。

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. 如果您尝试将它们放在受限制的区域,则需要其他权限才能执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM