Mail Archives: djgpp/2005/02/25/15:44:33
> From: Sterten AT aol DOT com
> Date: Thu, 24 Feb 2005 23:53:16 EST
>
> but I can create a file >4GB with a normal GCC-program:
> (on a NTFS-harddisk)
If that's true, it's just a sign of a subtle bug in the NT DOS
emulation. It should have failed any writes beyond 4GB.
> The file is opened and data is written to it.
> You can follow this process with multitasking from another
> DOS-commandline. You can peek into the file, while data is
> appended to it by a GCC-compiled program.
> You can open it with other C-programs
> until less than 4GB are written. Then suddenly you
> can't open the file with GCC-compiled programs,
> while DOS-commands "dir","type","copy" still work.
> This continues while the file still grows and after it's finished.
>
> Now, does the whole structure of the file change dramatically,
> when byte 2^32 is written ? Hard to believe.
The structure doesn't change a bit; the DOS system call used by the
DJGPP programs simply fails for files larger than 4GB. It fails
because DOS system calls aren't supposed to work for larger files, and
Microsoft didn't introduce any new system calls that DOS programs can
use.
The commands you call ``DOS-commands'' are not DOS commands at all:
they are native Windows commands implemented inside cmd.exe, the NT
shell that replaces command.com. So it's a small wonder that they
work with larger files: they are capable of calling the native Windows
APIs that support large files. Thus, you cannot compare DJGPP
programs with commands like "dir" and "copy".
> Seems to me that GCC just checks for the filesize and when it's too
> big then GCC exits with an error
It's not GCC that does this test, it's the DOS emulator that is part
of Windows! The file I/O system calls issued by DJGPP programs are
served within the DOS emuulator (called VDM), and it is there that the
file's size is checked and the system call forced to fail.
You have been told so many times in this thread that files larger than
4GB just won't work with DJGPP programs. Why cannot you accept that?
People who keep telling you this do know something about this issue,
believe me.
- Raw text -