Re: [AD] Clarifying and revising filesystem API

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


Peter Wang wrote:

al_set_default_stream_handler(ALLEGRO_FILE_VTABLE *vtable);

Passing NULL would reset to the builtin one.

I'm not particularly opposed to it, but I don't think prepending is that
hard, using al_ustr_newf() for example.  What cases are you thinking of?


Still hard enough. And I need to do it for every file I load - setting the default handler I would do only once at the start of my loading function. I also think it is nicer design in general to not make addons (like physfs) second class citizens by requiring string operations when using them while allowing our builtin stdio to be used without extra string operations.


I find this really confusing... when doing it like this, what is the remaining advantage of using this over the _entry version?

You wouldn't need two versions of every function, the string version and the
_entry version.

I thought we keep the _entry versions anyway? If they are completely removed I guess it makes more sense.


Elsewhere:
My vote also goes for directory operations. It's very common in games (e.g. list all files in the savegames folder).

Ok.  How about we keep directory operations but in a distinct part of the
API?  It wouldn't use ALLEGRO_FILEs and you couldn't hook the functions, so
they would only work with the local disk.

What's the advantage of this? Returning an ALLEGRO_FILE for each file in the directory makes the most sense. (Remember the problem we solved some time ago where we don't know the UTF8 name of each file/directory, and also should not have to.)

Then the questions about the
current directory would have obvious answers.

I think there are better ways to solve the current directory problem... in fact I don't see it as a real problem at all.

Thinking about it, I actually like the current API (even though ALLEGRO_FS_HANDLE is a horrible name compared to ALLEGRO_FILE). But basically, your proposal now kills the whole long-standing idea to have a VFS in A5... I'll need some time to accept that I think...

--
Elias Pschernig <elias@xxxxxxxxxx>




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