Configuration Files

General APL language issues

Configuration Files

Postby paulmansour on Thu Mar 03, 2022 6:15 pm

When I install a new version of Dyalog APL, I want to make one or zero changes and have it fire up with all my settings, colors, custom user commands, code loaded in ⎕SE, make coffee, etc.

Setting the UserConfigFile seems like it should be the way to do this.

So I have folder somewhere that contains this UserConfigFile, and other assets necessary for my setup (like custom user commands).

I would like to be able to specify file path parameters in this config file that point to file and folders that are in the folder that holds the config file. For example:

Code: Select all
Load: "[The place where my config file is]/SomeNameSpace.aplns",
SALT/CommandFolder: "[The place where my config file is]"
etc.


Is there a way to do this?
paulmansour
 
Posts: 418
Joined: Fri Oct 03, 2008 4:14 pm

Re: Configuration Files

Postby paulmansour on Fri Mar 04, 2022 1:53 am

It looks like some parameters will default their path to the location of the config file itself (good!) but others will not (not good):

      { 
Settings: {
MyRandomSetting: "Hello There",
Default_IO:0,
Load: "StartupFoo.aplf", //This works
DyalogStartup: 'c:/APLStartup/mystartup.dyalog', //works
// DyalogStartup: 'mystartup.dyalog', // Fails
SALT: {
CommandFolder: "c:/APLSTartup/UCMDs;[dyalog]/SALT/spice", //Works
// CommandFolder: "UCMDs;[dyalog]/SALT/spice" //Fails
}

}
}


I wonder if we need a formal way to specify the config file dir, it it does not already exist.
paulmansour
 
Posts: 418
Joined: Fri Oct 03, 2008 4:14 pm

Re: Configuration Files

Postby Vince|Dyalog on Tue Mar 08, 2022 10:20 am

Hi Paul,

I will use CFGDIR to mean the location where my config file is, but I will need to explicitly set it.

You can do this in config files:

WSPATH: ["[DYALOG]/ws", "d:/182ws", ""],
CFGDIR: "D:/temp/cfgfiles",
SESSION_FILE: "[CFGDIR]/c182uni64.dse",
log_file: "[CFGDIR]/mylog182u64.dlf",

SALT: {
CommandFolder:
"[CFGDIR]/dUCMDs;[DYALOG]/SALT/spice", //Works
},
      ⍝⍝Then in a Dyalog using the above configuration file:
+2 ⎕nq '.' 'getenvironment' 'session_file'
D:/temp/cfgfiles/c182uni64.dse
+2 ⎕nq '.' 'getenvironment' 'log_file'
D:/temp/cfgfiles/mylog182u64.dlf
]settings cmddir
D:/temp/cfgfiles/dUCMDs;C:\Program Files\Dyalog\Dyalog APL-64 18.2 Unicode/SALT/spice
+2 ⎕nq '.' 'getenvironment' 'wspath'
C:\Program Files\Dyalog\Dyalog APL-64 18.2 Unicode/ws;d:/182ws;

Regards,

Vince
Vince|Dyalog
 
Posts: 408
Joined: Wed Oct 01, 2008 9:39 am

Re: Configuration Files

Postby Vince|Dyalog on Tue Mar 08, 2022 2:48 pm

Hi Paul,

Also, I have logged your request for "a formal way to specify the config file dir" as RFE 19723.

Regards,

Vince
Vince|Dyalog
 
Posts: 408
Joined: Wed Oct 01, 2008 9:39 am


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest