build without disk-free-space on android
This commit is contained in:
parent
b095561e70
commit
6623b557ed
2 changed files with 19 additions and 2 deletions
|
@ -6,12 +6,15 @@
|
|||
-}
|
||||
|
||||
{-# OPTIONS_GHC -fno-warn-tabs #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Utility.DiskFree (
|
||||
getDiskFree,
|
||||
getDiskSize
|
||||
) where
|
||||
|
||||
#ifndef __ANDROID__
|
||||
|
||||
import System.DiskSpace
|
||||
import Utility.Applicative
|
||||
import Utility.Exception
|
||||
|
@ -21,3 +24,15 @@ getDiskFree = catchMaybeIO . getAvailSpace
|
|||
|
||||
getDiskSize :: FilePath -> IO (Maybe Integer)
|
||||
getDiskSize = fmap diskTotal <$$> catchMaybeIO . getDiskUsage
|
||||
|
||||
#else
|
||||
|
||||
#warning Building without disk free space checking support
|
||||
|
||||
getDiskFree :: FilePath -> IO (Maybe Integer)
|
||||
getDiskFree _ = return Nothing
|
||||
|
||||
getDiskSize :: FilePath -> IO (Maybe Integer)
|
||||
getDiskSize _ = return Nothing
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue