[Issue 11791] std.file.write failed to write huge files

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 29 00:37:47 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11791



--- Comment #5 from Илья Ярошенко <ilyayaroshenko at gmail.com> 2014-01-29 00:37:44 PST ---
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > import std.file;
> > > 
> > > void main() {
> > >     auto data = new byte[2L^^31];
> > >     std.file.write("data", data);
> > > }
> > > 
> > > std.file.FileException at std/file.d(391): data: Success
> > 
> > works fine with 2L^^30
> 
> Ok, so that line indicates that the call to "close" failed (returned non-zero),
> but didn't set errno, which is weird.
> 
> One possibility is that you are running a 32-bit kernel, and write will only be
> able to write INT_MAX bytes, which would explain the error (although I would
> have hoped for it to set errno). Are you running a 32-bit kernel?
> 
> I suppose an alternate question is: can you write a file like this using plain
> C functions, or is it a D specific issue? Phobos literally just forwards the
> call onto a few C functions (open file, write, close), so I suspect it is not
> an issue in Phobos.

kubuntu 13.04

$ uname -a
Linux Y 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux

D programs also are x86_64, but it is possible to use x86_32 C library in
ubuntu.

With std.stdio.File I can write an 6 GB files.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list