English Amiga Board

Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

Thread Tools
Old 22 September 2013, 20:34   #1
Registered User

Firestone's Avatar
Join Date: Apr 2013
Location: Norway
Posts: 81
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:

Address command 'C:path ram:temp ADD'
Script seems to run fine, no errors. But the directory is never added to path for some reason.
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?
Firestone is offline  
Old 22 September 2013, 20:47   #2
Registered User
thomas's Avatar
Join Date: Jan 2002
Location: Germany
Posts: 5,878
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).
thomas is offline  
Old 23 September 2013, 13:44   #3
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 2,392
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.
daxb is offline  
Old 22 May 2015, 18:25   #4
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
If you run your script from a CLI, I think you could do something like:
WriteLn('con','Path ADD mypath:')

at the end of your script.
idrougge is offline  
Old 22 May 2015, 20:21   #5
Registered User

BigFan's Avatar
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.

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

BigFan is offline  
Old 07 May 2017, 05:28   #6
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
Or, if you run your script from the CLI, you can just PUSH or QUEUE your commands and they will be performed on exit.
idrougge is offline  

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 18:27
Crash when entering path to add harddrive thomas support.WinUAE 1 12 September 2010 15:38
2.2 default path changes sun68 support.WinUAE 4 19 July 2010 22:31
Path command... illy5603 New to Emulation or Amiga scene 16 29 September 2008 01:15
Golden Path coach support.Games 3 16 December 2002 23:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 12:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06737 seconds with 15 queries