rnso rnso - 3 years ago 172
Linux Question

What-dir reporting own directory as current directory in Rebol

I am running Rebol on Debian Stable Linux and I have put rebol executable in /usr/local/bin. Then I have created following script file and also kept it in /usr/local/bin:

#! /usr/local/bin/rebol


print what-dir

However, when I run this script from any directory, it only reports "/usr/local/bin/" and not current working directory. I want to get current working directory to perform operations from code.

Following code, using Linux shell command
(print working directory) also reports the same:

print call "pwd"

How can this problem be solved?

Answer Source

You can find your own directory where you are in system/options/path and if you want it to be your current working directory and what-dir to report your own directory as current directory, you have to add this line

system/script/path: system/options/path


change-dir system/options/path

before calling what-dir.

Even print call "pwd" uses and shows now your own as current directory

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download