Handbook
Glossary
make-directories ( path -- )
Factor handbook
»
Input and output
»
Directory manipulation
»
Creating directories
Prev:
make-directory ( path -- )
Vocabulary
io
.
directories
Inputs
path
a pathname string
Outputs
None
Word description
Creates a directory and any parent directories which do not yet exist.
Errors
Throws an error if the directories could not be created.
Definition
USING:
combinators.short-circuit
io.backend
io.files
io.pathnames
kernel
sequences
;
IN:
io.directories
:
make-directories
( path -- )
normalize-path
trim-tail-separators
dup
{
[
"."
=
]
[
root-directory?
]
[
empty?
]
[
file-exists?
]
}
1||
[
make-parent-directories
dup
make-directory
]
unless
drop
;