You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to target non-technical users, any steps other than double clicking on an executable is asking for trouble. On OS X, when an R3 executable is started by double clicking it in the Finder, the working directory is set to the user's home rather than the directory where the binary is located.
As an example, with RebolBot, the executable and the main script are placed together in a directory. When launching the binary, a non-technical user will need to change Rebol's working directory to where the executable was launched from and then run the main script. The changing of the working directory should not be necessary.
Unfortunately, there's nothing R3 can easily do about that, it's a "feature" of Finder: Finder changes the working directory to the user's home directory before executing the binary.
Rebolbot commented on Apr 17, 2013:
Submitted by:abolka
Note that this is part of a bigger portability problem, which will still need a bit of work (there are various open tickets about the correct setting of system/options fields).
On a more helpful note, when R3 is started with a script, it currently changes the working directory to the script's directory, so if you can set up an association in Finder to launch .r3 scripts via R3, then double-clicking on the main RebolBot script should work.
Rebolbot commented on Apr 17, 2013:
Submitted by:BrianH
There is a similar but unrelated problem in Windows with the same effect, which has another ticket.
Thanks for finding that. The Windows analog to this bug was discovered when I was trying to replicate the #! functionality on Windows using .cmd file tricks. Does OSX have this same problem for scripts launched using a #! line at the top of the script?
The text was updated successfully, but these errors were encountered:
Having associated *.r3 files with Terminal application and having rebol3 in /usr/local/bin/, double-clicking on script which looks like:
#!rebol3
Rebol []
probe what-dir
ask "DONE"
It properly reports working directory of the script.
With fixed #2459 there is also correct system/options/boot with absolute path to Rebol. system/options/home should be now user's home dir, or directory defined by REBOL_HOME environment variable.
Submitted by: adrians
When trying to target non-technical users, any steps other than double clicking on an executable is asking for trouble. On OS X, when an R3 executable is started by double clicking it in the Finder, the working directory is set to the user's home rather than the directory where the binary is located.
As an example, with RebolBot, the executable and the main script are placed together in a directory. When launching the binary, a non-technical user will need to change Rebol's working directory to where the executable was launched from and then run the main script. The changing of the working directory should not be necessary.
Imported from: CureCode [ Version: r3 master Type: Issue Platform: Mac OSX Category: Platform Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#2026
Comments:
Submitted by: abolka
Unfortunately, there's nothing R3 can easily do about that, it's a "feature" of Finder: Finder changes the working directory to the user's home directory before executing the binary.
Submitted by: abolka
Note that this is part of a bigger portability problem, which will still need a bit of work (there are various open tickets about the correct setting of system/options fields).
On a more helpful note, when R3 is started with a script, it currently changes the working directory to the script's directory, so if you can set up an association in Finder to launch .r3 scripts via R3, then double-clicking on the main RebolBot script should work.
Submitted by: BrianH
There is a similar but unrelated problem in Windows with the same effect, which has another ticket.
Submitted by: abolka
Similar Windows problem: #1892
Submitted by: BrianH
Thanks for finding that. The Windows analog to this bug was discovered when I was trying to replicate the #! functionality on Windows using .cmd file tricks. Does OSX have this same problem for scripts launched using a #! line at the top of the script?
The text was updated successfully, but these errors were encountered: