| Copyright | 2008 David Roundy <droundy@darcs.net> | 
|---|---|
| License | GPL | 
| Maintainer | darcs-devel@darcs.net | 
| Stability | experimental | 
| Portability | portable | 
| Safe Haskell | Safe | 
| Language | Haskell2010 | 
Darcs.Util.Workaround
Description
- renameFile :: FilePath -> FilePath -> IO ()
- setExecutable :: FilePath -> Bool -> IO ()
- getCurrentDirectory :: IO FilePath
- installHandler :: Signal -> Handler -> Maybe SignalSet -> IO Handler
- raiseSignal :: Signal -> IO ()
- data Handler :: *- = Default
- | Ignore
- | Catch (IO ())
- | CatchOnce (IO ())
- | CatchInfo (SignalInfo -> IO ())
- | CatchInfoOnce (SignalInfo -> IO ())
 
- type Signal = CInt
- sigINT :: CInt
- sigHUP :: CInt
- sigABRT :: CInt
- sigALRM :: CInt
- sigTERM :: CInt
- sigPIPE :: CInt
Documentation
renameFile :: FilePath -> FilePath -> IO ()
renameFile old new
The operation may fail with:
- HardwareFaultA physical I/O error has occurred.- [EIO]
- InvalidArgumentEither operand is not a valid file name.- [ENAMETOOLONG, ELOOP]
- isDoesNotExistError/- NoSuchThingThe original file does not exist, or there is no path to the target.- [ENOENT, ENOTDIR]
- isPermissionError/- PermissionDeniedThe process has insufficient privileges to perform the operation.- [EROFS, EACCES, EPERM]
- ResourceExhaustedInsufficient resources are available to perform the operation.- [EDQUOT, ENOSPC, ENOMEM, EMLINK]
- UnsatisfiedConstraintsImplementation-dependent constraints are not satisfied.- [EBUSY]
- UnsupportedOperationThe implementation does not support renaming in this situation.- [EXDEV]
- InappropriateTypeEither path refers to an existing directory.- [ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]
setExecutable :: FilePath -> Bool -> IO () Source
getCurrentDirectory :: IO FilePath
If the operating system has a notion of current directories,
getCurrentDirectory returns an absolute path to the
current directory of the calling process.
The operation may fail with:
- HardwareFaultA physical I/O error has occurred.- [EIO]
- isDoesNotExistError/- NoSuchThingThere is no path referring to the current directory.- [EPERM, ENOENT, ESTALE...]
- isPermissionError/- PermissionDeniedThe process has insufficient privileges to perform the operation.- [EACCES]
- ResourceExhaustedInsufficient resources are available to perform the operation.
- UnsupportedOperationThe operating system has no notion of current directory.
Note that in a concurrent program, the current directory is global
state shared between all threads of the process.  When using
filesystem operations from multiple threads, it is therefore highly
recommended to use absolute rather than relative FilePaths.
installHandler int handler iset calls sigaction to install an
   interrupt handler for signal int.  If handler is Default,
   SIG_DFL is installed; if handler is Ignore, SIG_IGN is
   installed; if handler is Catch action, a handler is installed
   which will invoke action in a new thread when (or shortly after) the
   signal is received.
   If iset is Just s, then the sa_mask of the sigaction structure
   is set to s; otherwise it is cleared.  The previously installed
   signal handler for int is returned
raiseSignal :: Signal -> IO ()
raiseSignal int calls kill to signal the current process
   with interrupt signal int.
data Handler :: *
The actions to perform when a signal is received.
Constructors
| Default | |
| Ignore | |
| Catch (IO ()) | |
| CatchOnce (IO ()) | |
| CatchInfo (SignalInfo -> IO ()) | Since: 2.7.0.0 | 
| CatchInfoOnce (SignalInfo -> IO ()) | Since: 2.7.0.0 |