Changeset 17042 for src/Pugs/Prim/FileTest.hs
- Timestamp:
- 07/14/07 03:52:25 (1 year ago)
- Files:
-
- src/Pugs/Prim/FileTest.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/Pugs/Prim/FileTest.hs
r15616 r17042 61 61 fileTime :: (FilePath -> IO Integer) -> Val -> Eval Val 62 62 fileTime test f = do 63 t <- fileTestIO (fileTestDo test) f63 t <- fileTestIO (fileTestDo test) f 64 64 if (t == undef) then return VUndef else do 65 t' <- fromVal t66 b <- (readVar $ cast "$*BASETIME") >>= fromVal67 return $ VRat $ (b - (pugsTimeSpec $ TOD t' 0)) / 8640065 t' <- fromVal t :: Eval Integer 66 b <- fromVal =<< readVar (cast "$*BASETIME") 67 return $ VRat $ (b - (pugsTimeSpec . posixSecondsToUTCTime $ fromIntegral t')) / 86400 68 68 69 69 fileTestIO :: (Value n) => (n -> IO Val) -> Val -> Eval Val
