Changeset 14599 for src/Pugs/Compat.hs

Show
Ignore:
Timestamp:
11/03/06 05:30:51 (2 years ago)
Author:
allbery_b
svk:copy_cache_prev:
41990
Message:

AUTHORS: hello, world\n :)
src/Pugs/Compat.hs: added file time tests
src/Pugs/Internals.hs, src/Pugs/Prim.hs: abstract out guts of "time" for

use in $*BASETIME and file tests

src/Pugs/Run.hs: add $*BASETIME
src/Pugs/AST.hs: document _reserved and filterUserDefinedPad; add $*BASETIME

to _reserved

src/Pugs/Prim.hs: add file time operators -M, -C, -A
src/Pugs/Prim/FileTest.hs: add implementation of file time operators
t/operators/filetest.t: correct existing file time operator tests, add a few

more, add all of them to the plan

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compat.hs

    r13464 r14599  
    2525    getArg0, 
    2626    statFileSize, 
     27    statFileMTime, 
     28    statFileCTime, 
     29    statFileATime, 
    2730    getProcessID, 
    2831    getRealUserID, 
     
    97100    return (toInteger (fileSize s)) 
    98101 
     102statFileTime :: (FileStatus -> EpochTime) -> FilePath -> IO Integer 
     103statFileTime op f = do 
     104    s <- getFileStatus f 
     105    return (toInteger $ fromEnum $ op s) 
     106 
     107statFileMTime :: FilePath -> IO Integer 
     108statFileMTime f = statFileTime modificationTime f >>= return 
     109 
     110statFileCTime :: FilePath -> IO Integer 
     111statFileCTime f = statFileTime statusChangeTime f >>= return 
     112 
     113statFileATime :: FilePath -> IO Integer 
     114statFileATime f = statFileTime accessTime f >>= return 
     115 
    99116type Signal = System.Posix.Signals.Signal 
    100117signalProcess :: Signal -> ProcessID -> IO ()