Bug - Fixed net.sourceforge.kolmafia.swingui. OptionsFrame could not be loaded

I was running KoLmafia from a flash drive, using the Java property -DuseCWDasROOT=true in the launch parameters. Tried to load the Preferences Window while not logged in, and got this debug log.

I wonder if I'm specifying the Java property incorrectly.
 
Last edited:
Just tested under the same conditions on Windows. The bug does NOT occur there, so it must be related to KoLmafia's handling of the -DuseCWDasROOT=true Java option on non-Windows platforms at the very least (that option has no effect on Windows).
 

Veracity

Developer
Staff member
Windows ALWAYS "uses CWD as Root". Here is the one and only place in KoLmafia source where that definition is examined:

Code:
	public static final File BASE_LOCATION = new File( System.getProperty( "user.dir" ) ).getAbsoluteFile();
	public static final File HOME_LOCATION = new File( System.getProperty( "user.home" ) ).getAbsoluteFile();

	public static final File ROOT_LOCATION =
		Boolean.getBoolean( "useCWDasROOT" ) ?
		UtilityConstants.BASE_LOCATION :
		UtilityConstants.USE_OSX_STYLE_DIRECTORIES ?
		new File( UtilityConstants.HOME_LOCATION, "Library/Application Support/KoLmafia" ) :
		UtilityConstants.USE_LINUX_STYLE_DIRECTORIES ?
		new File( UtilityConstants.HOME_LOCATION, ".kolmafia" ) :
		UtilityConstants.BASE_LOCATION;

As you can see, for non-OSX, Non-Linux systems, the root directory is BASE_LOCATION - which is exactly what the Java define forces.

What exactly is your Current Working Directory when you execute KoLmafia off a flash drive from OS X?
 
Windows ALWAYS "uses CWD as Root". Here is the one and only place in KoLmafia source where that definition is examined:

Code:
	public static final File BASE_LOCATION = new File( System.getProperty( "user.dir" ) ).getAbsoluteFile();
	public static final File HOME_LOCATION = new File( System.getProperty( "user.home" ) ).getAbsoluteFile();

	public static final File ROOT_LOCATION =
		Boolean.getBoolean( "useCWDasROOT" ) ?
		UtilityConstants.BASE_LOCATION :
		UtilityConstants.USE_OSX_STYLE_DIRECTORIES ?
		new File( UtilityConstants.HOME_LOCATION, "Library/Application Support/KoLmafia" ) :
		UtilityConstants.USE_LINUX_STYLE_DIRECTORIES ?
		new File( UtilityConstants.HOME_LOCATION, ".kolmafia" ) :
		UtilityConstants.BASE_LOCATION;

As you can see, for non-OSX, Non-Linux systems, the root directory is BASE_LOCATION - which is exactly what the Java define forces.

What exactly is your Current Working Directory when you execute KoLmafia off a flash drive from OS X?
The current working directory is /Volumes/KOLMAFIA (which is the name of the flash drive I use). It is FAT32-formatted, in case that matters.
 

Veracity

Developer
Staff member
OK. So ".." is "/Volumes" and "../.." is "/".

Your debug log was dealing with the FileSelectPanel for the "External Script Editor" seeing if "../.." was a prefix to that path. I'll look at it.
 
Top