[Hat] Strange error using hat-trail and hat-observe

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Oct 4 09:43:13 EDT 2004


Thomas Davie <tatd2 at kent.ac.uk> writes:

> I'm getting a very strange error when I run either of the main two hat 
> utilities:
> 
> dhcp2966:~/Documents/Work/SECD Machine tatd100$ hat-trail SECDmachine
> Fail: /tmp/hmakeconfig.1273: removeFile: failed (Bad file descriptor)

The error message mentions the file '/tmp/hmakeconfig.xxxx'.  This is
a temporary file (badly named, I know) allocated by 'runAndReadStdout'
in the hattools module Run.hs.  The latter function is used mainly in
HighlightStyle.hs to get the terminal window size.

Here is the usage of 'removeFile' in 'runAndReadStdout':

    s <- readFile output
    removeFile output   -- file will not be removed until readFile closes it
    return (safeinit s) -- strip trailing newline added by shell

It looks like maybe your /tmp filesystem does somthing clever, or maybe
we really need to suck in the contents of the file before removing it?

Regards,
    Malcolm


More information about the Hat mailing list