Hi,

I am using Haskell to write Alfred programs, but I have run into an issue I just can not fix. The routine for reading a data file in a application specific location for Alfred never detects the file as non-existant. It then dies on the read. Here is the code:

getAlfredCacheFileContents :: String -> IO (String)
getAlfredCacheFileContents fileName = do
    h <- getHomeDirectory
    fExist <- doesFileExist $ h ++ cacheDirBasic ++ getBundleID ++ "/" ++ fileName
    if fExist
    then do
        contents <- readFile $ h ++ cacheDirBasic ++ getBundleID ++ "/" ++ fileName
        return contents
    else
        return ""

I just installed the latest version on my Mac Air. It always does the call to readFile, even when the file doesn't exist.
--
Sent with Postbox