X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory.hs;fp=System%2FDirectory.hs;h=269f4fdbe226f294a0ec2d1132f4220ac2facc59;hb=177d37b54a1098e7778d496fafdfe0c6d83c894d;hp=688a10ba087eaffdb754f10a46bfbb91b8f199c4;hpb=4def4746644e1ce7026d5a08cc5213ec410a17f2;p=haskell-directory.git diff --git a/System/Directory.hs b/System/Directory.hs index 688a10b..269f4fd 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -936,10 +936,15 @@ getModificationTime name = do modificationTime st #else stat <- Posix.getFileStatus name - let realToInteger = round . realToFrac :: Real a => a -> Integer - return (TOD (realToInteger (Posix.modificationTime stat)) 0) + let mod_time :: Posix.EpochTime + mod_time = Posix.modificationTime stat + dbl_time :: Double + dbl_time = realToFrac mod_time + return (TOD (round dbl_time) 0) #endif - + -- For info + -- round :: (RealFrac a, Integral b => a -> b + -- realToFrac :: (Real a, Fractional b) => a -> b #endif /* __GLASGOW_HASKELL__ */ @@ -963,8 +968,9 @@ withFileOrSymlinkStatus loc name f = do modificationTime :: Ptr CStat -> IO ClockTime modificationTime stat = do mtime <- st_mtime stat - let realToInteger = round . realToFrac :: Real a => a -> Integer - return (TOD (realToInteger (mtime :: CTime)) 0) + let dbl_time :: Double + dbl_time = realToFrac (mtime :: CTime) + return (TOD (round dbl_time) 0) isDirectory :: Ptr CStat -> IO Bool isDirectory stat = do