Message-ID: <521592F9.3020407 at icculus.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
four separate directories:
- Installation directory
- Application Data directory
- User Data directory
- Application Invocation directory
Let’s not over-complicate this. In practice, it’s only two things
(“where do I read?” and “where do I write?”).
Where I work, we have multi-user computers that run time card
software. For obvious reasons we don’t want people to have the ability
to modify any of the associated files, thus the program needs to be
available from a user account that doesn’t have the permissions to
modify it. However, what if it downloads an update (I don’t think it
has this ability, mind you, this is just a very easy leap to make)?
You’ll want to be able to apply the update from any user account
(because you don’t know which will be used when), but you still want
tour program directory protected, AND you want to store any
unimportant settings wherever is appropriate. Thus, three directories,
all of which may be in a different location, depending on the OS:
- Installation directory (shared execute/read; on Windows, Program Files),
- Application Data directory (shared read/write),
- User Data directory (user read/write; the home directory, My Documents).
The invocation directory was mentioned for completeness, other than an
image viewer I can’t really think of why you would care about this
from SDL. The other three, in comparison, matter for any multi-user
environment.
Another use-case:
Your game has player accounts. You want any player account to be
usable from any OS account, but you also want OS accounts to have a
player account that will load automatically. Solution? Store the
account data in the shared directory, and an “auto-load” file in the
user directory. If the user wants to use a different account, they can
back out of the one they’re currently in.
char const *SDL_get_location (char const *abstract_location_name);
I, for one, like this idea, but I have a question:
The goal isn’t to build an abstract means to configure the way the
system thinks about file layout, the goal is to understand where files
go, as dictated by the standards for that platform, using
platform-specific APIs behind the scenes that obtain this information so
the app doesn’t have to.
Point. And if someone really cares, they can write it themselves.
However, none of this diminishes the value of directories 1-3.> Date: Thu, 22 Aug 2013 00:26:33 -0400
From: “Ryan C. Gordon”
To: SDL Development List
Subject: Re: [SDL] Thoughts on the new filesystem API
From my perspective, the above three snippets actually describe up to
Date: Thu, 22 Aug 2013 02:08:28 -0300
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] Thoughts on the new filesystem API
Message-ID:
<CAEyBR+VXHKYCq-xCtNWO_XKW1KpBHcHh+wOegwi4HqTtd2Lb1g at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
2013/8/22, Jared Maddox <@Jared_Maddox>:
- Application Invocation directory
Isn’t that just the current directory?
Yes. I considered actually wording it like that, but I decided clarity
was of more value than succinctness.
Date: Thu, 22 Aug 2013 02:10:01 -0300
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] Thoughts on the new filesystem API
Message-ID:
<CAEyBR+VxckwASX-nEjmVHFGdxAibnohFYvwKVqeuMqQxFKVA1A at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Whoops, sorry for the empty e-mail (clicked the wrong thing). But
yeah, now I see where the list comes from, you need separate
directories for global settings and user-specific settings. So yeah,
that indeed makes it three directories (the fourth item is still
pointless though, you don’t care from where your program runs after
all).
Oh, I agree, but as I best recall I actually got than from one of
Sam’s descriptions: I honest-to-goodness read four different
descriptions between those three posts.
Date: Thu, 22 Aug 2013 16:09:09 -0400
From: Edward Rudd
To: SDL Development List
Subject: Re: [SDL] Thoughts on the new filesystem API
Message-ID:
Content-Type: text/plain; charset=“us-ascii”
Now, one “nicety” of the way the SDL hint system works… Is I do not have to
set my hints via the SDL_SetHint… I can set them via the env…
So I can add this to my Info.plist
LSEnvironment
SDL_FILESYSTEM_OSX_USE_RESOURCE_DIR
1
Certainly an upshot of shoehorning any possible configurability into
the hint system. It would (just as an example) allow developers to use
different invocation scripts to test version compatibility: for each
new “external” version make a new directory, and a new invocation
script that redirects the filesystem API to that directory. Testing an
executable for compatibility with multiple data & plugin versions
becomes as simple as going down a list of scripts.