Add directory to path with ARexx?
Been doing some projects lately with ARexx just for the fun of it, and came accross a weird problem when trying to add a new path with the AmigaDOS-command "Path"
I'm doing this inside the .rexx script with the following code: Code:
Address command 'C:path ram:temp ADD' I then tried to add path to a directory that don't exist, and then it will output errors, so the command seems to be run fine. Can anyone please explain me why this is not working inside this script? |
I don't think you can change local shell-specific things from ARexx. The problem is that ADDRESS COMMAND calls Execute() or System() for each command and these DOS functions create a new CLI. The new CLI inherits its path from the parent, then the command is executed and it changes the path of the new CLI only. Finally the new CLI is destroyed again together with its changed path. The path of the parent CLI is never touched. The same applies to the current directory (CD command) and local variables (Set and Get commands).
|
Alternative in hypothesis of you just want to have a temp dir/place. Why you don`t use "Ram:T" or simply "Ram:"? Path is more or less for global search places and should made in S-S or U-S. In most cases path entries will never removed.
|
If you run your script from a CLI, I think you could do something like:
Open('con','*','WRITE') WriteLn('con','Path ADD mypath:') at the end of your script. |
As already mentioned, you can't add a local setting globally. Your path is correctly added, then thrown away, when closing current shell.
If you really want to enhance your actual shell, then add your path to a specific shell-startup, name it what you like , run a new shell with 'from' keyword and your newly created shell-start as input. e.g. echo >ram:t/pathvar path Dummydrive: add newshell from ram:t/pathvar now your shell has got the new path (Dummydrive: here) as set by your script Cheers |
Or, if you run your script from the CLI, you can just PUSH or QUEUE your commands and they will be performed on exit.
|
All times are GMT +2. The time now is 08:13. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.