getLastModified :: FilePath -> IO UTCTime
getLastModified "-" = getCurrentTime
getLastModified fpath = getFileStatus fpath
- >>= return . posixSecondsToUTCTime . toEnum . fromEnum . modificationTime
+ >>= return . posixSecondsToUTCTime . fromRational . toRational . modificationTime
getETag :: [CmdOpt] -> Lazy.ByteString -> IO String
examples/HelloWorld.hs
examples/Makefile
+Flag build-lucu-implant-file
+ Description: Build the lucu-implant-file program.
+ Default: True
+
Library
Build-Depends:
Crypto, base, bytestring, containers, directory, haskell-src,
-funbox-strict-fields
Executable lucu-implant-file
+ if flag(build-lucu-implant-file)
+ Buildable: True
+ else
+ Buildable: False
Main-Is: ImplantFile.hs
ghc-options:
-Wall
+ -XUnboxedTuples
-funbox-strict-fields
--Executable HelloWorld
$ abort Forbidden [] Nothing
-- 讀める
tag <- liftIO $ generateETagFromFile path
- lastMod <- return $ posixSecondsToUTCTime $ toEnum $ fromEnum $ modificationTime stat
+ lastMod <- return $ posixSecondsToUTCTime $ fromRational $ toRational $ modificationTime stat
foundEntity tag lastMod
-- MIME Type を推定