English Amiga Board


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

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

Firestone's Avatar
 
Join Date: Apr 2013
Location: Norway
Posts: 68
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'
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  
AdSense AdSense  
Old 22 September 2013, 19:47   #2
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,672
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 online now  
Old 23 September 2013, 12:44   #3
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,003
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, 17:25   #4
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,546
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.
idrougge is offline  
Old 22 May 2015, 19:21   #5
BigFan
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.

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
BigFan is offline  
Old 07 May 2017, 04:28   #6
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,546
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  
AdSense AdSense  
 


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

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 19:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06403 seconds with 13 queries