title: Variable not in scope: getFileStatus turned into Failed to load interface for ‘System.Posix.Files.Common’ when importing the relevant package
body: <p>I have the following code which I got from <a href="https://stackoverflow.com/questions/5620332/faster-alternatives-to-hfilesize-to-retrieve-the-size-of-a-file-in-haskell">here</a>, I want a function that will find the size of a file</p>
  <pre><code>getFileSize :: String -&gt; IO Integer
  getFileSize path = do
      stat &lt;- getFileStatus path
      return $ fromIntegral (hFileSize stat)
  </code></pre>
  <p>This code gave the error 'Variable not in scope: getFileStatus'</p>
  <p>I found that the variable is part of Posix, so I imported the files in the new code:</p>
  <pre><code>import System.IO
  import System.Posix.Types
  import System.Posix.Files.Common
  import System.Posix.Error
  import System.Posix.Internals
  
  
  getFileSize :: String -&gt; IO Integer
  getFileSize path = do
      stat &lt;- getFileStatus path
      return $ fromIntegral (hFileSize stat)
  </code></pre>
  <p>Now I get the error:
  error:
  Failed to load interface for ‘System.Posix.Files.Common’
  it is a hidden module in the package ‘unix-2.7.2.1’
  Use -v to see a list of the files searched for.</p>