2017-10-28 4 views
2

Red言語で異なるパスを取得しようとしています。以下のコマンド/myfolderおよび実行するために私のCDの場合:Red言語で異なるパスを取得する

/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のパスと現在の作業ディレクトリのパスを取得するにはどうしたらいいですか?

注:この時点で

system/options/boot ;; /path/to/red.exe 
system/options/path ;; /myfolder 
system/script/path  ;; /path/to/myscript.red 

だけsystem/options/boot:これはREBOLの(2 & 3)ではWhat-dir reporting own directory as current directory in Rebol

答えて

0

でREBOLの上の私の質問に関連して、これはあなたがこれらの3つのパスを取得する方法ですレッドはレボルがここで行うことと一致している。 GUIコンソールから

0

boot    string!  {C:\ProgramData\Red\gui-console-2017-11-30-4300.exe} 
home    none!   none 
path    file!   %/C/ProgramData/Red/ 
script   none!   none 
cache   file!   %/C/ProgramData/Red/ 

CLIから:

boot    string!  "C:\ProgramData\Red\console-2017-11-30-4430. 
home    none!   none 
path    file!   %/C/Users/Old%20Man/desktop/ 
script   none!   none 
cache   file!   %/C/ProgramData/Red/ 

GUIコンソールを使用する場合:

system/options/boot ; Red binary 
system/options/path ; current dir 
system/options/cache ; Red default dir "home" 

システム/オプション/ブートはstring!あるので、あなたそれを変換する必要があります:

to-red-file system/options/boot 
関連する問題