Handbook
Glossary
cleanup-unique-directory ( quot -- )
Unique files
Prev:
with-unique-directory ( quot -- path )
Next:
safe-replace-file ( ..a original-path quot: ( ..a copy-path -- ..b ) -- ..b )
Vocabulary
io
.
files
.
unique
Inputs
quot
a
quotation
Outputs
None
Word description
Creates a directory with
unique-directory
and calls the quotation using
with-directory
to set it as the
current-directory
.
Notes
The unique directory will be deleted after calling this word, even if an error is thrown in the quotation.
See also
unique-directory
,
with-unique-directory
Definition
USING:
continuations
io.directories
;
IN:
io.files.unique
::
cleanup-unique-directory
( quot -- )
unique-directory
:>
path
[
path quot
with-directory
]
[
path
delete-tree
]
finally
;
inline