English Amiga Board


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

 
 
Thread Tools
Old 04 November 2021, 12:54   #1
Tolgod
Registered User
 
Tolgod's Avatar
 
Join Date: Apr 2019
Location: Heerlen / The Netherlands
Posts: 52
set script path as relative path

Hi there,


I have a simple question. How can I have a script refer to files using a relative path.
ie


scipt :
run <script'scurrentlocation>/filesfolder/file


The idea is that the folder with the script inside and some folder, with files in it that are invoked by the script, can be moved anywhere and the script will still function because it is referring to the other files' location in a manner relative to the script's own current location.


What would be the easiest way to do this ?

Last edited by Tolgod; 04 November 2021 at 13:29.
Tolgod is offline  
Old 04 November 2021, 14:01   #2
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,180
just use

Run /filesfolder/file

dont mention any device/volume/etc, not sure about scripts, but launched programs can also refer to PROGDIR: which is the folder they were launched in.
DisasterIncarna is offline  
Old 04 November 2021, 19:44   #3
Tolgod
Registered User
 
Tolgod's Avatar
 
Join Date: Apr 2019
Location: Heerlen / The Netherlands
Posts: 52
Hi there and tnx for helping out.

Wow....completely overlooked the simple fact here that the script will open it's own cli at current root. So simple and logic, I feel silly
Happy you put me on the right path again (pun intended :$ :'D )
Tolgod is offline  
Old 05 November 2021, 13:08   #4
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
Just in case you don't know : in the S: folder is a script called PCD. It can be handy in some situations when moving from one folder to another and back is needed
malko 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
Non-relative rom-path bug. hceline support.WinUAE 3 21 January 2019 19:45
Possible to set root path for floppies in config? Foebane support.WinUAE 3 03 July 2018 00:11
Relative path in portable mode: bladecgn request.UAE Wishlist 2 01 October 2017 18:54
Install path ras2a support.FS-UAE 7 14 June 2015 17:42
How to set a subfolder as standard path for games ??? o.O TheChris80 support.WinUAE 9 22 November 2009 19:20

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 05:32.

Top

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