title: Operation not permitted when trying to use openFile in OS X
body: <p>While trying to read file on Mac using the below Haskell code, I am getting an error that permission is denied: Operation not permitted.</p>
  
  <pre><code>import System.IO
  
  main :: IO ()
  main = do
    inh &lt;- openFile "/Users/lambda/Downloads/file.doc" ReadMode
    inpStr &lt;- hGetContents inh
    let [(result,_)] = parse allDigits inpStr
    putStr result
    hClose inh
  
  result : ** Exception: /Users/lambda/Downloads/file.doc: openFile: permission denied (Operation not permitted)
  </code></pre>