unique-directory ( -- path )
Unique files

Prev:cleanup-unique-file ( ..a prefix suffix quot: ( ..a path -- ..b ) -- ..b )
Next:with-unique-directory ( quot -- path )


Vocabulary
io.files.unique

Inputs
None

Outputs
patha pathname string


Word description
Creates a directory in the current-directory that is guaranteed not to exist and return the full pathname. The mechanism for the guarantee of uniqueness is retrying with a unique-length randomly generated filename until make-directory succeeds.

Errors
Throws an error if the directory cannot be created after a unique-retries number of tries. The most likely error is incorrect directory permissions on the current-directory.

See also
with-unique-directory, cleanup-unique-directory

Definition