packages feed

easy-file 0.1.1 → 0.2.0

raw patch · 3 files changed

+18/−9 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ System.EasyFile: getFileSize :: FilePath -> IO Word64

Files

System/EasyFile.hs view
@@ -36,12 +36,6 @@  * Necessary functions in "System.Directory" and "System.FilePath". -This is alpha version. The specification would be changed in the-future. Please send comments to:--@-    <http://github.com/kazu-yamamoto/easy-file/issues>-@ -}  module System.EasyFile (@@ -80,6 +74,8 @@   , getChangeTime   , getModificationTime   , getAccessTime+  -- * Size+  , getFileSize   -- * File\/directory information   , isSymlink   , getLinkCount
System/EasyFile/Missing.hs view
@@ -7,7 +7,9 @@ import Control.Applicative import Data.Time import Data.Time.Clock.POSIX+import Data.Word (Word64) #if defined(mingw32_HOST_OS) || defined(__MINGW32__)+import Control.Exception import System.Win32.File import System.Win32.Time #else@@ -148,4 +150,16 @@ #else epochTimeToUTCTime :: EpochTime -> UTCTime epochTimeToUTCTime = posixSecondsToUTCTime . realToFrac+#endif++-- | Getting the size of the file.+getFileSize :: FilePath -> IO Word64+#if defined(mingw32_HOST_OS) || defined(__MINGW32__)+getFileSize file = bracket setup teardown body+  where+    setup = createFile file gENERIC_READ fILE_SHARE_READ Nothing oPEN_EXISTING fILE_ATTRIBUTE_NORMAL Nothing+    teardown = closeHandle+    body fh = fromIntegral . bhfiSize <$> getFileInformationByHandle fh+#else+getFileSize file = fromIntegral . fileSize <$> getFileStatus file #endif
easy-file.cabal view
@@ -1,16 +1,15 @@ Name:                   easy-file-Version:                0.1.1+Version:                0.2.0 Author:                 Kazu Yamamoto <kazu@iij.ad.jp> Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp> License:                BSD3 License-File:           LICENSE Synopsis:               Cross-platform File handling-Description:            Cross-platform File handling for Unix/Mac/Windows+Description:            Cross-platform File handling for Unix\/Mac\/Windows Homepage:               http://github.com/kazu-yamamoto/easy-file Category:               System Cabal-Version:          >= 1.6 Build-Type:             Simple-Tested-with:            GHC == 7.6.1  Library   GHC-Options:          -Wall