Re: [AD] implementing seek

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


On 2010-04-08, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> 
> Attached is my current favorite proposal:
> 
> ALLEGRO_FILE *al_fopen_slice(ALLEGRO_FILE *fh, size_t initial_size,
> bool expandable)
> 
> (The third parameter could be a set of flags instead.)
> 
> It's meant to allow you to treat a subsection of a random access file
> as a new, self-contained file.

Nice.

The initial_size parameter should be int64_t.

> The file mode (read/write) is inherited from the parent.
> 
> If the initialize size is set past the actual size of a read-only
> file, the behavior is undefined.
> 
> It does not work with sequential files, but it could if a memory
> buffer were implemented upon detecting (if possible) that random
> access was not allowed.

Or add it as a flag in the third parameter.

Peter




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