Re: [AD] relative fs entry |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon Dec 10, 2012, Peter Wang wrote:
> 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?
I don't think it is. That wording was just me documenting the behavior, and
not what actually made sense.
> (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
I say do whatever makes the most sense, and is the most useful in the general
case.
> ---------------------------------------------------------------------------
> --- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support Improve
> your efficiency, and focus on delivering more value-add services Discover
> what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
--
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx