apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: apr-util/buckets apr_buckets_file.c
Date Thu, 05 Jul 2001 14:37:34 GMT
On Thu, 5 Jul 2001, Bill Stoddard wrote:

> Maybe there is something very fundamental that I a missing here.
> Each 8K chunk that is read causes the system to increment its file
> pointer for that open fd. You should not need to call seek() to do
> something the system is already doing for you under the covers.


   apr_file_t *f = ...;
   apr_bucket *a, *b, *c, *d;

   /* split the bucket into hunks of 100 bytes each */

   a = apr_bucket_file_create(f, 0, len, pool);
   b = apr_bucket_split(a, 100);
   c = apr_bucket_split(b, 100);
   d = apr_bucket_split(c, 100);

   APR_BUCKET_INSERT_AFTER(a, c);

   apr_bucket_destroy(b);
   apr_bucket_destroy(d);

You can't guarantee that consecutive reads from file buckets read from the
"next" spot in the file.  In fact, they very frequently jump around.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message