Permalink
Browse files

Conditional getModificationTime

  • Loading branch information...
jaspervdj committed Sep 24, 2012
1 parent 5041811 commit fe673bca7271fb901c4590affb395f6fba0ffd3d
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/Hakyll/Core/Resource/Provider/File.hs
@@ -1,5 +1,6 @@
-- | A concrete 'ResourceProvider' that gets it's resources from the filesystem
--
+{-# LANGUAGE CPP #-}
module Hakyll.Core.Resource.Provider.File
( fileResourceProvider
) where
@@ -29,6 +30,10 @@ fileResourceProvider configuration = do
(mtime . unResource)
where
mtime r = do
+#if MIN_VERSION_directory(1,2,0)
+ getModificationTime r
+#else
ct <- toCalendarTime =<< getModificationTime r
let str = formatCalendarTime defaultTimeLocale "%s" ct
return $ readTime defaultTimeLocale "%s" str
+#endif

0 comments on commit fe673bc

Please sign in to comment.