尝试在OS X中使用openFile时不允许操作

时间:2017-04-29 18:11:48

标签: macos haskell

尝试使用下面的Haskell代码在Mac上读取文件时,我收到一条错误,即权限被拒绝:操作不被允许。

import System.IO

main :: IO ()
main = do
  inh <- openFile "/Users/lambda/Downloads/file.doc" ReadMode
  inpStr <- hGetContents inh
  let [(result,_)] = parse allDigits inpStr
  putStr result
  hClose inh

result : ** Exception: /Users/lambda/Downloads/file.doc: openFile: permission denied (Operation not permitted)

0 个答案:

没有答案