ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/02/25/15:44:33

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Fri, 25 Feb 2005 22:42:19 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-ID: <01c51b7a$Blat.v2.4$a51f9e40@zahav.net.il>
X-Mailer: emacs 22.0.50 (via feedmail 8 I) and Blat ver 2.4
In-reply-to: <15b.4b75cad0.2f50093c@aol.com> (Sterten@aol.com)
Subject: Re: files > 4GB There is always a solution
References: <15b DOT 4b75cad0 DOT 2f50093c AT aol DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019