www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Large file support?

reply Jose Quinteiro <jquinteiro keibiinc.com> writes:
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.
Apr 19 2007
next sibling parent reply Dan <murpsoft hotmail.com> writes:
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...
Apr 19 2007
parent Jose Quinteiro <jquinteiro keibiinc.com> writes:
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.
Apr 19 2007
prev sibling parent reply Pragma <ericanderton yahoo.removeme.com> writes:
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
Apr 19 2007
parent reply Jose Quinteiro <jquinteiro keibiinc.com> writes:
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.
Apr 19 2007
parent reply BCS <BCS pathlink.com> writes:
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
Apr 19 2007
parent reply Jose Quinteiro <jquinteiro keibiinc.com> writes:
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.
Apr 20 2007
parent Dan <murpsoft hotmail.com> writes:
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.
Apr 20 2007