Fwd: Re[2]: What causes hsc2hs "permission denied" errors during
build?
Brian Smith
brianlsmith at gmail.com
Thu Sep 7 18:12:50 EDT 2006
On 9/7/06, Bulat Ziganshin
<bulat.ziganshin at gmail.com> wrote:
>
> Hello Esa,
>
> Thursday, September 7, 2006, 1:34:13 PM, you wrote:
>
> > The problem is that removeFile is called for a file that has an open
> handle,
> > because the handle is not garbage collected yet.
>
> a workaround may be to call "performGC" just before removeFile
hsc2hs generates an EXE file, then executes it, then waits for that process
to finish, and then attempts to delete the file. The file is never opened by
hsc2hs directly so the GC does not seem to be the cause.
It seems that even though waitForProcess returns successfully, Windows still
an open file handle for the EXE file when removeFile is called. That is
really surprising because I expect that the file should be free to delete
after waitForProcess has returned.
I tried to rewrite the code so that it enters a remove-catch "permission
denied"-sleep loop but I could not find a portable "sleep" IO action. For
now, I just commented out the entire removeFile action.
Regards,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/glasgow-haskell-users/attachments/20060907/13a0f8e6/attachment.htm
More information about the Glasgow-haskell-users
mailing list