2017-10-28 5 views
2

Red 언어로 다른 경로를 얻으려고합니다. 만약 명령 다음에 I의 /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의 경로와 현재 작업 디렉토리의 경로를 어떻게 얻을 수 있습니까 (Red 언어 - Rebol 아님)?

참고 :이은 (2 & 3) REBOL에서 What-dir reporting own directory as current directory in Rebol

답변

0

에서 REBOL에 내 질문에 관련되어, 이것은 당신이이 세 가지 경로를 얻을 수있는 방법이다 : 지금이 순간

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

system/options/boot 레드 (Red)는 레볼 (Rebol)이 여기에서하는 것과 일치합니다.

0
은 GUI 콘솔에서

:

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 콘솔을 사용 : CLI에서

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/ 

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

시스템/옵션/부팅이 string!, 그래서 당신 다음으로 변환해야합니다.

to-red-file system/options/boot