22 September 2013, 19:34 | #1 |
Registered User
Join Date: Apr 2013
Location: Norway
Posts: 249
|
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? |
22 September 2013, 19:47 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
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).
|
23 September 2013, 12:44 | #3 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
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.
|
22 May 2015, 17:25 | #4 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
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. |
22 May 2015, 19:21 | #5 |
Registered User
Join Date: Feb 2014
Location: Germany
Posts: 261
|
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 |
07 May 2017, 04:28 | #6 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
Or, if you run your script from the CLI, you can just PUSH or QUEUE your commands and they will be performed on exit.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I add unzip (extract) to Directory Opus? | Nostromo | support.Apps | 2 | 11 September 2013 17:27 |
Crash when entering path to add harddrive | thomas | support.WinUAE | 1 | 12 September 2010 14:38 |
2.2 default path changes | sun68 | support.WinUAE | 4 | 19 July 2010 21:31 |
Path command... | illy5603 | New to Emulation or Amiga scene | 16 | 29 September 2008 00:15 |
Golden Path | coach | support.Games | 3 | 16 December 2002 22:09 |
|
|