Show
Ignore:
Timestamp:
07/14/07 03:52:25 (1 year ago)
Author:
audreyt
Message:

* Switch from System.Time to the newer Data.Time modules

for localtime(), time(), the :M filetest, etc.
(No user-visible changes.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/Pugs/Prim/FileTest.hs

    r15616 r17042  
    6161fileTime :: (FilePath -> IO Integer) -> Val -> Eval Val 
    6262fileTime test f = do 
    63     t <- fileTestIO (fileTestDo test) f 
     63    t   <- fileTestIO (fileTestDo test) f 
    6464    if (t == undef) then return VUndef else do 
    65     t' <- fromVal t 
    66     b <- (readVar $ cast "$*BASETIME") >>= fromVal 
    67     return $ VRat $ (b - (pugsTimeSpec $ TOD t' 0)) / 86400 
     65    t' <- fromVal t :: Eval Integer 
     66    b   <- fromVal =<< readVar (cast "$*BASETIME") 
     67    return $ VRat $ (b - (pugsTimeSpec . posixSecondsToUTCTime $ fromIntegral t')) / 86400 
    6868 
    6969fileTestIO :: (Value n) => (n -> IO Val) -> Val -> Eval Val