Handbook
Glossary
redirect ( obj mode fd -- )
Vocabulary
io
.
launcher
.
unix
Inputs
obj
an
object
mode
an
object
fd
an
object
Outputs
None
Definition
USING:
accessors
combinators
io.backend.unix
io.launcher
io.ports
kernel
strings
;
IN:
io.launcher.unix
:
redirect
( obj mode fd -- )
{
{
[
pick
not
]
[
3drop
]
}
{
[
pick
string?
]
[
redirect-file
]
}
{
[
pick
appender?
]
[
redirect-file-append
]
}
{
[
pick
+closed+
eq?
]
[
redirect-closed
]
}
{
[
pick
fd?
]
[
[
drop
fd>>
dup
reset-fd
]
dip
redirect-fd
]
}
[
[
underlying-handle
]
2dip
redirect
]
}
cond
;