Re: [AD] standard path updates

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2 Mar 2011, at 1:21 , Matthew Leverton wrote:
> Of course. You would call the proper Win32 function to get the name of
> ProgramData. But without that al_set_directory function, how is
> Allegro supposed to know that's where you decided to put it? (As
> opposed to local data or in My Documents, etc.) It cannot, unless you
> tell it somehow.

No, but aren't we overthinking this in a sense?
Couldn't we simply return whatever the appropriate value for ProgramData is and leave it up to the user to assemble a complete path from that?

> You could set the Allegro app name and make it the convention that it
> *must* be in C:\ProgramData\$AppName. (Although that location was
> introduced in later versions of Windows, so it isn't quite so
> straightforward.)

Is there an alternative?

> However, maybe the programmer bundled data, in which
> case you wouldn't want to return that. So you'd need a different
> constant (not RESOURCES) to indicate the system read-only data folder.

The way I see it is this: the purpose of those functions is to help provide a number of standard locations where the program can look for its associated data. However, when looking for that data, the program should loop over a number of possibilities because some locations may not be defined on all systems, or the user may override some of the default files.
In a sense, that can already be done behind the screens through PhysFS. Perhaps this is something that Allegro's default file IO functions could also do, or something that an addon (not depending on PhysFS) could so. Point for another discussion though.

> I don't think anybody disagrees that it would be nice to have a cross
> platform way of detecting where program data has been installed, but
> that's really just not possible to know for sure at run time unless
> Allegro has been given a hint.

That's ok though.

> I think having a guess-work solution is worse than having none at all.

I would prefer a reasonable default guess that can be corrected by providing extra information to having no default guess at all and forcing me to do it explicitly for every platform I may want to support. But that's certainly a personal preference where no single solution will make everyone happy.

> It was discussed and the consensus was that it should, but as far as I
> know, it does not. I didn't know what the proper way to do that was,
> so I left it unimplemented and asked for somebody else to add that
> part.

The easiest way would be to use teh BSD function "realpath" if it's available. Not sure what the fall-back option would be though.

> I would not, however, resolve EXENAME, but there wasn't agreement on that.

Makes sense, but I haven't thought it through.
I don't think EXENAME is all that useful anyway though...

Evert



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/