Re: [AD] relative fs entry

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


On Sun, 9 Dec 2012 04:43:46 -0700, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> On Sun Dec 9, 2012, Peter Wang wrote:
> > Hi,
> > 
> > Is a ALLEGRO_FS_ENTRY created from a relative path supposed to be
> > interpreted relative to the _current_ working directory, or the
> > directory that was current when the ALLEGRO_FS_ENTRY was created?
> > 
> > I would assume the latter but it's behaving as the former.
> 
> Yeah, you're right. Internally it should probably be turned into an absolute 
> path so it always points at the original file. The fact that it doesn't is 
> very much a bug. Complete brain fart on my end.

I wonder if we should take this wording as binding:

    ## API: al_get_fs_entry_name

    Returns the entry's filename path. Note that the path will not be an
    absolute path if the entry wasn't created from an absolute path.

That implies we always need to hold two paths per entry, the absolute
path and a copy of what the user passed in in the first place.
Which is fine, but is it useful for some reason?

(We actually have two paths in the current implementation, but
for no particular reason I can see.)

Also, the physfs addon doesn't respect that wording after the change
to introduce a cwd.

Peter




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