Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to the Hackage Docs for <a href="http://hackage.haskell.org/package/directory-1.2.0.1/docs/System-Directory.html#v%3aremoveFile" rel="nofollow"><code>removeFile</code></a>, the operation may fail with:</p> <blockquote> <p>isPermissionError / PermissionDenied The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]</p> </blockquote> <p>Also, according to the <a href="http://hackage.haskell.org/package/directory-1.2.0.1/docs/src/System-Directory.html#removeFile" rel="nofollow">source code</a> there, <code>removeFile</code> is just a thin wrapper around <code>deleteFile</code> in the Win32 API:</p> <pre><code>removeFile :: FilePath -&gt; IO () removeFile path = #if mingw32_HOST_OS Win32.deleteFile path #else Posix.removeLink path #endif </code></pre> <hr /> <p><b>Update</b></p> <p>After digging around the source code for winhugs, it seems the Windows API function <code>unlink</code> is actually being used to delete a file in Hugs:</p> <pre><code>primFun(primRemoveFile) { /* remove a file */ int rc; String s = evalName(IOArg(1)); if (!s) { IOFail(mkIOError(NULL, nameIllegal, "Directory.removeFile", "illegal file name", &amp;IOArg(1))); } rc = unlink(s); if (rc != 0) throwErrno("Directory.removeFile", TRUE, NO_HANDLE, &amp;IOArg(1)); IOReturn(nameUnit); } </code></pre> <p>In any case, the previous answer is going to hold up in the sense that any permissions constraint is not introduced by Haskell. Rather, any permissions error would be due to the underlying OS environment (user accounts, open files, permissions, etc).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload