logo       

Uninformative error message from getModificationTime: msg#00072

lang.haskell.glasgow.bugs

Subject: Uninformative error message from getModificationTime

Hi,

If I run the program

main = print =<< readFile "god"

and god doesn't exist, I get the following informative error message

Fail: does not exist
Action: openFile
Reason: No such file or directory
File: god

However, if I run the program

import Directory
main = print =<< getModificationTime "god"

I get the message

Fail: does not exist
Action: withFileStatus
Reason: No such file or directory

where the file name isn't included. I guess I could write my own wrapper around getModificationTime to generate a better error message, but presumably other functions implemented by calls to withFileStatus suffer from the same problem, so it is better to fix the problem there.

This was tested with GHC 5.04.2 under Linux.

--
Thomas H

"I think it would be a great idea."
(Ghandi's answer when asked what he thought of Western Civilization)


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise