Handbook
Glossary
directory-to-string ( path -- string )
Vocabulary
tools
.
directory-to-file
Inputs
path
an
object
Outputs
string
an
object
Definition
USING:
base91
combinators
escape-strings
io.backend
io.directories
io.encodings.binary
io.encodings.utf8
io.files
io.files.info
io.pathnames
kernel
sequences
splitting
;
IN:
tools.directory-to-file
::
directory-to-string
( path -- string )
path
normalize-path
[
path-separator
=
]
trim-tail
"/"
append
[
recursive-directory-files
]
keep
dup
[
?head
drop
]
curry
[
map
[
{
{
[
dup
file-info
directory?
]
[
directory-repr
]
}
{
[
dup
file-is-text?
]
[
dup
utf8
file-contents
escape-string
file-repr
]
}
[
dup
binary
file-contents
>base91
""
like
escape-string
"base91"
prepend
file-repr
]
}
cond
]
map
]
curry
with-directory
"\n\n"
join
"<DIRECTORY: "
path
escape-simplest
"\n\n"
3append
"\n\n;DIRECTORY>"
surround
;