Other operating systems and the octree cache

Information, contacts and source code for ports to Linux, Windows, etc.

Moderators: winston, another_commander

Post Reply
User avatar
winston
Pirate
Pirate
Posts: 731
Joined: Mon Sep 27, 2004 10:21 pm
Location: Port St. Mary, Isle of Man
Contact:

Other operating systems and the octree cache

Post by winston »

The octree cache on OS X is stored in $HOME/Library/Application Data/Oolite. On UNIX+GNUstep, this path is $HOME/GNUstep/Library/Application Data/Oolite (and is created the first time by the 'oolite' script that sets the environment and runs the game). I'm not certain how ensuring this is created on Windows will work, but I assume that the script that starts it on Windows can use the Windows HOMEPATH (IIRC) environment variable to find the user's GNUstep directory.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Hmm. On OS X, it really ought to be in Library/Caches. For efficiency, I’d strongly reccomend switching to binary plist format under OS X ([NSPropertyListSerialization dataFromPropertyList:plist format:NSPropertyListBinaryFormat_v1_0 errorDescription:NULL]; available from OS X 10.2). I’d have used a date stamp and possibly a checksum to detect model changes, but hey. Oh, and it’s “leaves”, not “leafs”. :-)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Oh, one other thing: each binary data cache should have a flag indicating endianness. The simplest way to do this is to include a cookie value like 0x12345678 and ensure that it reads back correctly.
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1161
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Post by aegidian »

Ahruman wrote:
Oh, one other thing: each binary data cache should have a flag indicating endianness. The simplest way to do this is to include a cookie value like 0x12345678 and ensure that it reads back correctly.
I'm not sure we need this, caches aren't intended to be shared between machines - the main cache only need be read by the machine that wrote it.
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

However, the way the cache is stored now it is potentially shared between machines. It is not unheard of to have a home directory on a networked volume, and this will only become more common as NAS solutions become cheaper. This is why, for instance, there exists a ~/Library/Preferences/ByHost/ (accessible via CFPreferences but apparently not NSUserDefaults).
Post Reply