Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hackage.Security.Util.IO
Contents
Miscelleneous
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.