【发布时间】:2014-11-10 16:46:25
【问题描述】:
我正在使用Red binding 读写文件,硬编码文件名版本运行良好。但我想从命令行动态获取文件名。因为Red 现在没有这样的实用程序。所以我尝试使用Red/System 来实现。我现在可以获得命令行参数,但我不知道如何将它传递给Red 部分。像下面的例子,我需要将source-file和target-file传递给read和write:
Red []
#include %input-output.red
#system-global [
args: system/args-list
args: args + 1
source-file: args/item
args: args + 1
target-file: args/item
print [source-file target-file ]
]
data: read source-file
probe data
write target-file data
【问题讨论】:
标签: red