Handbook
Glossary
absolute-path? ( path -- ? )
Vocabulary
io
.
pathnames
Inputs
path
a pathname string
Outputs
?
a
boolean
Word description
Tests if a pathname is absolute. Examples of absolute pathnames are
/foo/bar
on Unix and
c:\foo\bar
on Windows.
See also
windows-absolute-path?
,
root-directory?
Definition
USING:
combinators
io.pathnames.private
kernel
sequences
system
;
IN:
io.pathnames
:
absolute-path?
( path -- ? )
{
{
[
dup
empty?
]
[
drop
f
]
}
{
[
dup
special-path?
nip
]
[
drop
t
]
}
{
[
os
windows?
]
[
windows-absolute-path?
]
}
{
[
dup
first
path-separator?
]
[
drop
t
]
}
[
drop
f
]
}
cond
;