【发布时间】:2026-01-17 09:20:02
【问题描述】:
我正在尝试用红色语言获得不同的路径。如果我 cd 到 /myfolder 并运行以下命令:
/myfolder$ /path/to/red.exe /path/to/myscript.red
如何从脚本中的代码中获取这 3 条路径?
我试过了:
system/options/path ; Gives path/to/myscript
system/script/path ; Gives none
call/output "pwd" outstr ; Gives path/to/myscript
what-dir ; Gives path/to/myscript
我只能走一条路。如何获取 red.exe 的路径和当前工作目录的路径(红色语言 - 不是 Rebol)?
注意:这与我在 What-dir reporting own directory as current directory in Rebol 上关于 Rebol 的问题有关
【问题讨论】: