Other operating systems and the octree cache
Moderators: winston, another_commander
- winston
- 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
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.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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”. :-)
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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.
E-mail: [email protected]
- aegidian
- Master and Commander
- Posts: 1161
- Joined: Thu May 20, 2004 10:46 pm
- Location: London UK
- Contact:
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.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.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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).
E-mail: [email protected]