hackage-security-0.5.2.2: Hackage security library

Safe Haskell | None
Language | Haskell2010

Hackage.Security.Util.IO

Contents

- Miscelleneous
- Debugging

Synopsis

- getFileSize :: (Num a, FsRoot root) => Path root -> IO a
- handleDoesNotExist :: IO a -> IO (Maybe a)
- withDirLock :: Path Absolute -> IO a -> IO a
- timedIO :: String -> IO a -> IO a

# Miscelleneous

getFileSize :: (Num a, FsRoot root) => Path root -> IO a #

handleDoesNotExist :: IO a -> IO (Maybe a) #

withDirLock :: Path Absolute -> IO a -> IO a #

Attempt to create a filesystem lock in the specified directory

Given a file `pathto`, we do this by attempting to create the directory `/pathto/hackage-security-lock`, and deleting the directory again afterwards. Creating a directory that already exists will throw an exception on most OSs (certainly Linux, OSX and Windows) and is a reasonably common way to implement a lock file.

# Debugging

timedIO :: String -> IO a -> IO a #