Boost logo

Boost-Build :

From: Joao Abecasis (jpabecasis_at_[hidden])
Date: 2005-09-02 07:31:12


Alexey Pakhunov wrote:
> Joao Abecasis wrote:
>
>> if ( !fseek( file, 0L, SEEK_END ) )
>> {
>> size_t filesize = ftell( file );
>>
>> ret = allocate( filename, filesize );
>>
>
>
> I see two problems:
> 1. Loading of >100MB file into the memory is not a good idea;

We could add a default 1MB (?) limit and change the signature to,

rule CAT ( file : max_bytes ? )

> 2. Files can be larger than 2GB (4GB).

Well, I assumed allocation would fail and an empty list would be
returned. Adding a limit to the number of bytes read would allow us to
read at least the beginning of large files.

Of course another question entirely is if we should care about files
that large. I didn't notice support for large files (>2GB) elsewhere in
bjam (of course I may have overlooked it).

Do you think adding a default or even a hard-coded limit for the number
of bytes read would fix these issues or are you suggesting that the
approach is flawed from the beginning?

Thanks for your feedback!

João Abecasis

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk