[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] unexpected behavior from filterM doesFileExist =<< ge

Subject: Re: [Haskell-cafe] unexpected behavior from filterM doesFileExist =<< getDirectoryContents
From: "Brandon S. Allbery KF8NH"
Date: Sun, 10 Jan 2010 00:30:31 -0500
On Jan 10, 2010, at 00:24 , Thomas Hartman wrote:
Can somebody explain this?

getDirectoryContents inD
["..","#sanity
.txt
#",".","sanity
.txt
","etc
.txt
","patchTagDir
.txt
","jail
.txt","notjail.txt","alldata.txt","allobjs.txt","namesNSizes.txt"]

filterM doesFileExist =<< getDirectoryContents inD
["sanity.txt"]

My first guess is that inD isn't "."; getDirectoryContents doesn't fully qualify the names it returns, so doesFileExist looks in the current directory for the bare names returned.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected]
system administrator [openafs,heimdal,too many hats] [email protected]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
<Prev in Thread] Current Thread [Next in Thread>