Handbook
Glossary
cleanup-unique-file ( ..a prefix suffix quot: ( ..a path -- ..b ) -- ..b )
Unique files
Prev:
unique-file ( prefix suffix -- path )
Next:
unique-directory ( -- path )
Vocabulary
io.files.unique
Inputs
prefix
a
string
suffix
a
string
quot
a
quotation
with stack effect
( ..a path -- ..b )
Outputs
None
Word description
Creates a file with
unique-file
and calls the quotation with the path name on the stack.
Notes
The unique file will be deleted after calling this word, even if an error is thrown in the quotation.
See also
unique-file
Definition
USING:
continuations
io.directories
kernel
;
IN:
io.files.unique
::
cleanup-unique-file
( ..a prefix suffix quot: ( ..a path -- ..b ) -- ..b )
prefix suffix
unique-file
:>
path
[
path quot
call
]
[
path
delete-file
]
finally
;
inline