GZip File Reading

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 11 05:04:55 PST 2011


On Thu, 10 Mar 2011 20:29:55 -0500, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 3/10/2011 6:24 AM, dsimcha wrote:
>> On 3/10/2011 4:59 AM, Walter Bright wrote:
>>> On 3/9/2011 8:53 PM, dsimcha wrote:
>>>> I'd like to get some comments on what an appropriate API design and
>>>> implementation for writing gzipped files would be. Two key
>>>> requirements are that
>>>> it must be as easy to use as std.stdio.File and it must be easy to
>>>> extend to
>>>> support other single-file compression formats like bz2.
>>>
>>> Use ranges.
>>
>> Ok, obviously. The point was trying to figure out how to maximize the  
>> reuse of
>> the infrastructure from std.stdio.File.
>
> It's not so obvious based on my reading of the other comments. For  
> example, we should not be inventing a streaming interface.

C's FILE * interface is too limiting/low performing.  I'm working to  
create a streaming interface to replace it, and then we can compare the  
differences.  I think it's pretty obvious from Tango's I/O performance  
that a D-based stream interface is a better approach.

Ranges should be built on top of that interface.

I won't continue the debate, since it's difficult to argue from a position  
of theory.  However, I don't think it will be long before I can show some  
real numbers.  I'm not expecting Phobos to adopt, based on my experience  
with dcollections, but it should be seamlessly usable with Phobos,  
especially since range-based functions are templated.

-Steve


More information about the Digitalmars-d mailing list