Rebol 编程/echo
外观
< Rebol 编程
ECHO target
将控制台输出复制到文件。
ECHO 是一个函数值。
- 目标 -- (类型:文件 无 逻辑)
- 捕获
echo: func [
"Copies console output to a file."
[catch]
target [file! none! logic!]
][
if port? system/ports/echo [
close system/ports/echo
system/ports/echo: none
]
if target = true [target: %rebol-echo.txt]
if file? target [
system/ports/echo: throw-on-error [open/write/new/direct target]
]
]