posix-filelock-0.1: Nice wrapper around POSIX fcntl advisory locks

Safe HaskellSafe-Infered

System.Posix.FileLock

Synopsis

Documentation

lock :: MonadIO m => FilePath -> LockType -> m FileLockSource

Get a lock of the given type on the given path

unlock :: MonadIO m => FileLock -> m ()Source

Release a lock

withLock :: MonadIO m => FilePath -> LockType -> IO a -> m aSource

Gets the lock, executes the IO action, and then releases the lock. Releases the lock even if an exception occurs.