{-# LANGUAGE DataKinds #-}
{-# LANGUAGE Safe #-}
module Lukko.NoOp (
FileLockingNotSupported(..),
fileLockingSupported,
FileLockingSupported,
FileLockingMethod (..),
fileLockingMethod,
LockMode(..),
FD,
fdOpen,
fdClose,
fdLock,
fdTryLock,
fdUnlock,
hLock,
hTryLock,
hUnlock,
) where
import Control.Exception (throwIO)
import System.IO (Handle)
import Lukko.Internal.FD
import Lukko.Internal.Types
fileLockingSupported :: Bool
fileLockingSupported :: Bool
fileLockingSupported = Bool
False
type FileLockingSupported = 'False
fileLockingMethod :: FileLockingMethod
fileLockingMethod :: FileLockingMethod
fileLockingMethod = FileLockingMethod
MethodNoOp
hLock :: Handle -> LockMode -> IO ()
hLock :: Handle -> LockMode -> IO ()
hLock Handle
_ LockMode
_ = FileLockingNotSupported -> IO ()
forall e a. Exception e => e -> IO a
throwIO FileLockingNotSupported
FileLockingNotSupported
hTryLock :: Handle -> LockMode -> IO Bool
hTryLock :: Handle -> LockMode -> IO Bool
hTryLock Handle
_ LockMode
_ = FileLockingNotSupported -> IO Bool
forall e a. Exception e => e -> IO a
throwIO FileLockingNotSupported
FileLockingNotSupported
hUnlock :: Handle -> IO ()
hUnlock :: Handle -> IO ()
hUnlock Handle
_ = FileLockingNotSupported -> IO ()
forall e a. Exception e => e -> IO a
throwIO FileLockingNotSupported
FileLockingNotSupported
fdLock :: FD -> LockMode -> IO ()
fdLock :: FD -> LockMode -> IO ()
fdLock FD
_ LockMode
_ = FileLockingNotSupported -> IO ()
forall e a. Exception e => e -> IO a
throwIO FileLockingNotSupported
FileLockingNotSupported
fdTryLock :: FD -> LockMode -> IO Bool
fdTryLock :: FD -> LockMode -> IO Bool
fdTryLock FD
_ LockMode
_ = FileLockingNotSupported -> IO Bool
forall e a. Exception e => e -> IO a
throwIO FileLockingNotSupported
FileLockingNotSupported
fdUnlock :: FD -> IO ()
fdUnlock :: FD -> IO ()
fdUnlock FD
_ = FileLockingNotSupported -> IO ()
forall e a. Exception e => e -> IO a
throwIO FileLockingNotSupported
FileLockingNotSupported