Thread overview
Large file support?
Apr 19, 2007
Jose Quinteiro
Apr 19, 2007
Dan
Apr 19, 2007
Jose Quinteiro
Apr 19, 2007
Pragma
Apr 19, 2007
Jose Quinteiro
Apr 19, 2007
BCS
Apr 20, 2007
Jose Quinteiro
Apr 20, 2007
Dan
April 19, 2007
I could not find any way to open large files using D/Phobos streams.  I wound up writing a little C turdlet to handle this.

Since Phobos calls the C library, I think adding support for this could be as simple as compiling dmd with _FILE_OFFSET_BITS defined to 64.
April 19, 2007
Jose Quinteiro Wrote:

> I could not find any way to open large files using D/Phobos streams.  I wound up writing a little C turdlet to handle this.
> 
> Since Phobos calls the C library, I think adding support for this could be as simple as compiling dmd with _FILE_OFFSET_BITS defined to 64.

I'm not sure, but I think it's presently defined as size_t; which is aliased to either long or int depending on the system.  I don't think they used uint or ulong...
April 19, 2007
Jose Quinteiro wrote:
> I could not find any way to open large files using D/Phobos streams.  I wound up writing a little C turdlet to handle this.

Have you tried using MmFileStream?  Seems to me that, or BufferedFile, would be the way to go.

FWIW, Tango has some rather sophisticated file-IO that is up to the task for big files as well.

-- 
- EricAnderton at yahoo
April 19, 2007
Pragma wrote:
> 
> Have you tried using MmFileStream?  Seems to me that, or BufferedFile, would be the way to go.
> 
BufferedFile is what I was using.  It gave me "File too large" or whatever opening a 6GB file.  Never heard of MmFileStream, is there doc for it somewhere?

Thanks,
Jose.
April 19, 2007
Dan wrote:
> 
> I'm not sure, but I think it's presently defined as size_t; which is aliased to either long or int depending on the system.  I don't think they used uint or ulong...

It refused to open the file at all with a "File too large" error.
April 19, 2007
Jose Quinteiro wrote:
> Pragma wrote:
> 
>>
>> Have you tried using MmFileStream?  Seems to me that, or BufferedFile, would be the way to go.
>>
> BufferedFile is what I was using.  It gave me "File too large" or whatever opening a 6GB file.  Never heard of MmFileStream, is there doc for it somewhere?
> 
> Thanks,
> Jose.


http://www.digitalmars.com/d/phobos/std_stream.html
at the bottom
April 20, 2007
BCS wrote:
> 
> http://www.digitalmars.com/d/phobos/std_stream.html
> at the bottom

I had never noticed that.  And I was using SliceStream, too.  I'm embarrassed.
April 20, 2007
Jose Quinteiro Wrote:
> I had never noticed that.  And I was using SliceStream, too.  I'm embarrassed.

Don't be.  You should see how many times I've made mistakes on these forums this month.  People are probably remembering me by name so they can ignore my posts...

: p

Best of luck then.