Subject: RE: EXE has file junk in it
From: [email-masked] (Andrew Evans)

11 Jun 1997 22:13:15 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <19970611203914116.AAA73.cygnus.gnu-win32@balingwire>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Comments: Authenticated sender is <ade@[208.192.4.16]>
Original-To: [email-masked]
Original-CC: Sergey Okhapkin <[email-masked]>
In-reply-to: <[email-masked]>
X-mailer: Pegasus Mail for Win32 (v2.53/R1)
Original-Sender: [email-masked]

Sergey Okhapkin wrote:

> I just tried my seek test on NTWS 4.0 - resulting file is zero-filled...

I wrote something similar, though it uses stdio rather than UNIX I/O 
functions.  It produced files with zero-filled empty space on NT 3.51 
and NT 4.0 boxes.  3.51 box is the Workstation distribution with the 
appropriate registry tweaks to make it run in server mode.  4.0 box 
is an unmodified Workstation distribution.  Since the 
workstation/server kernels are identical save for the registry keys 
that determine which mode they run in, I tend to suspect that a 
"real" server distribution would produce files with zero-filled empty 
space as well.

Here's my test program, compiled on VC++ 4.2:

#include <stdio.h>
#include <stdlib.h>

void main()
{
 FILE* fp;

 if (! (fp = fopen("c:\\temp\\empty.dat", "wb")))
 {
  fprintf(stderr, "Can't open file for writing\n");
  exit(1);
 }
 if (fseek(fp, 20971520, SEEK_END))	// create 20MB of empty data
 {
  fprintf(stderr, "Can't seek past EOF\n");
  exit(1);
 }
 if (! fprintf(fp, "That's all, folks\n"))
 {
  fprintf(stderr, "Can't write to file\n");
  exit(1);
 }
 fclose(fp);
 exit(0);
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".