Configuration Files

General APL language issues
Post Reply
paulmansour
Posts: 431
Joined: Fri Oct 03, 2008 4:14 pm

Configuration Files

Post 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?
paulmansour
Posts: 431
Joined: Fri Oct 03, 2008 4:14 pm

Re: Configuration Files

Post 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.
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: Configuration Files

Post 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
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: Configuration Files

Post 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
Post Reply