Page 1 of 1

Configuration Files

Posted: Thu Mar 03, 2022 6:15 pm
by paulmansour
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?

Re: Configuration Files

Posted: Fri Mar 04, 2022 1:53 am
by paulmansour
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.

Re: Configuration Files

Posted: Tue Mar 08, 2022 10:20 am
by Vince|Dyalog
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

Re: Configuration Files

Posted: Tue Mar 08, 2022 2:48 pm
by Vince|Dyalog
Hi Paul,

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

Regards,

Vince