diff --git a/hpath-posix/hpath-posix.cabal b/hpath-posix/hpath-posix.cabal index c754b4c..140d654 100644 --- a/hpath-posix/hpath-posix.cabal +++ b/hpath-posix/hpath-posix.cabal @@ -34,6 +34,7 @@ library build-depends: base >= 4.8 && <5 , IfElse , bytestring >= 0.10 + , deepseq , exceptions >= 0.10 , hpath-filepath >= 0.10.3 , safe-exceptions >= 0.1 diff --git a/hpath-posix/src/System/Posix/RawFilePath/Directory/Traversals.hs b/hpath-posix/src/System/Posix/RawFilePath/Directory/Traversals.hs index a45defd..d5c5bbc 100644 --- a/hpath-posix/src/System/Posix/RawFilePath/Directory/Traversals.hs +++ b/hpath-posix/src/System/Posix/RawFilePath/Directory/Traversals.hs @@ -41,6 +41,7 @@ module System.Posix.RawFilePath.Directory.Traversals ( #if __GLASGOW_HASKELL__ < 710 import Control.Applicative ((<$>)) #endif +import Control.DeepSeq import Control.Monad import System.Posix.FilePath (()) import System.Posix.Foreign @@ -193,10 +194,11 @@ readDirEnt (unpackDirStream -> dirp) = if (r == 0) then do dEnt <- peek ptr_dEnt + putStrLn $ "readDirEnt dEnt " ++ (show dEnt) if (dEnt == nullPtr) then return (dtUnknown,BS.empty) else do - dName <- c_name dEnt >>= peekFilePath + dName <- c_name dEnt >>= peekFilePath >>= evaluate . force dType <- c_type dEnt c_freeDirEnt dEnt putStrLn $ "readDirEnt" ++ (show dName)