[GHC] #9266: getDirectoryContents blow its stack in a huge directory

GHC ghc-devs at haskell.org
Sat Jul 5 15:35:17 UTC 2014


#9266: getDirectoryContents blow its stack in a huge directory
----------------------------------------+----------------------------------
        Reporter:  joeyhess             |            Owner:
            Type:  bug                  |           Status:  new
        Priority:  normal               |        Milestone:
       Component:  libraries/directory  |          Version:  7.6.2
      Resolution:                       |         Keywords:
Operating System:  Linux                |     Architecture:
 Type of failure:  None/Unknown         |  Unknown/Multiple
       Test Case:                       |       Difficulty:  Unknown
        Blocking:                       |       Blocked By:
                                        |  Related Tickets:
----------------------------------------+----------------------------------

Comment (by joeyhess):

 One other idea:

 {{{
 openDirectory :: FilePath -> IO DirHandle

 readDirectory :: DirHandle -> IO (Maybe FilePath)
 -- closes DirHandle automatically at end
 }}}

 If directory included that interface, then code that needs to stream the
 directory could easily do so.
 removeDirectoryRecursive could use that instead of getDirectoryContents
 and avoid ever using a lot of memory. It could also probably be used to
 make a conduit, etc.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9266#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list