Re: [AD] implementing seek

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


On 2010-04-07, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> On Wed, Apr 7, 2010 at 5:31 PM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > I suppose there are three choices:
> >
> > 1. leave the position whereever it ends up
> > 2. return to the start of the slice
> > 3. skip past the slice
> >
> > Only (3) can be implemented when the stream is not backwards-seekable,
> > and it seems to me like the most useful behaviour anyway.
> >
> I agree.
> 
> Attached is a simple implementation of it as a user program for
> demonstration purposes.
> 
> Should a splice be able to work concurrently with a random-access
> parent? Or can two splices be open at the same time? In order to do
> so, it would have to implicitly seek before and after every
> read/write.

Let's keep it simple: no, and no.

> An aside: Can you query a file interface to determine what it
> supports? (Random access, write past end of file, etc)

Not yet, but I was considering the same thing.

> My proposal is that some form of this is added to the core I/O
> routines (not an addon). And subsequently, anybody who wants to treat
> a sub part of a file as a single entity to a loader / saver function
> must explicitly set up a splice.

Yes.  I'm not sure how a splice will work for saving though.

Peter




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