|Tries to perform some task if it can obtain the lock,
Otherwise, just gives up without doing the task
withTemp safely creates an empty file (not open for writing) and
returns its name.
The temp file operations are rather similar to the locking operations, in
that they both should always try to clean up, so exitWith causes trouble.
|withOpenTemp creates an already open temporary
file. Both of them run their argument and then delete the file. Also,
both of them (to my knowledge) are not susceptible to race conditions on
the temporary file (as long as you never delete the temporary file; that
would reintroduce a race condition).
withTempDir creates an empty directory and then removes it when it
is no longer needed. withTempDir creates a temporary directory. The
location of that directory is determined by the contents of
_darcsprefstmpdir, if it exists, otherwise by $DARCS_TMPDIR, and if
that doesn't exist then whatever your operating system considers to be a
a temporary directory (e.g. $TMPDIR under Unix, $TEMP under
If none of those exist it creates the temporary directory
in the current directory, unless the current directory is under a _darcs
directory, in which case the temporary directory in the parent of the highest
_darcs directory to avoid accidentally corrupting darcs's internals.
This should not fail, but if it does indeed fail, we go ahead and use the
current directory anyway. If $DARCS_KEEP_TMPDIR variable is set
temporary directory is not removed, this can be useful for debugging.
|withPermDir is like withTempDir, except that it doesn't
delete the directory afterwards.
|Produced by Haddock version 2.4.2|