ファイルの読み取りと書き込みにRed バインディングを使用していますが、ハードコードされたファイル名のバージョンはうまく機能します。しかし、コマンドラインから動的にファイル名を取得したいです。現在、そのRed
ようなユーティリティはありません。で作ってみましたRed/System
。Red
コマンド ライン引数を取得できるようになりましたが、それをパーツに渡す方法がわかりません。source-file
以下の例のように、 andtarget-file
にandを渡す必要が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