Re: [AD] implementing seek

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


On April 7, 2010, Peter Wang wrote:
> 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.

Probably like any handle would, except it gets EOF when/after it reaches the 
end of the slice. so its impossible to overwrite past the end.

> Peter
> 
> -------------------------------------------------------------------------
> ----- Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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