delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/07/13/20:39:00

X-Authentication-Warning: new-smtp1.ihug.com.au: Host p20-tnt1.syd.ihug.com.au [203.173.128.20] claimed to be acceleron
Message-ID: <000f01c10bfc$a0b5fcf0$0a02a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: <djgpp-workers AT delorie DOT com>
References: <200107121846 DOT UAA09493 AT father DOT ludd DOT luth DOT se>
Subject: Re: DJDIR Windows 2000 investigation results #1
Date: Sat, 14 Jul 2001 10:33:38 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Reply-To: djgpp-workers AT delorie DOT com

> According to Andrew Cottrell:
> > I will have written an app to create an approx 3GB file and the results
are
> > with the changes outlined above included in the io\_*.c files:
> >     Windows 98 FAT32 partition exe running on Windows 98 - OK 12/07/2001
> > 09:28p       2,946,776,700 TEST.BIN
> >     Windows 2000 NTFS partition exe running on Windows 2000 - OKAY
> > 12/07/2001  09:22p       2,946,776,700 TEST.BIN
> >     Windows 2000 FAT32 partition with exe running on Windows 2000 - OKAY
> > 12/07/2001  09:15p       2,946,776,700 TEST.BIN
> >
> > It all looks okay for writing a file > 2GB with the mods. If the mod
failed
> > what should have I seen?
>
> Have I understood you correctly that if you on WINDOZE 2k open a file
> on a FAT32 file system without the extended bit set, you can still
> write more than 2.5GiB to it?
>
> If so, amazing! But good for us.
>
> > The app uses fprintf to write in text mode 5,000 bytes of ASCII spaces
at a
> > time to the test.bin file. I hope I don't haev to do this again as it
takes
> > a long time to do on my Win98 box.
>
> You probably won't have to test it on a WINDOZE 98 box as I have one
> (except if you really want to).
Thanks.

I thought I should send the source for teh app I wrote that generated the
file just in case I didn't set a correct flag when openning the file. Before
I ran the app I deleted the test.bin file.

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>
#include <dir.h>
#include <string.h>

char line_length_500[] =
"                                                 "
"                                                 "
"                                                 "
"                                                 "
"                                                 "
"                                                 "
"                                                 "
"                                                 "
"                                                 "
"                                                 ";
FILE * OutputFilePointer;

static void main_exit_cleanup()
{
    if (OutputFilePointer)
    {
        fclose(OutputFilePointer);
        OutputFilePointer = NULL;
    }
}

int main(int argc, char *argv[])
{
   char OutputFilename[] = "TEST.BIN\0";
   unsigned long loop, file_size;
   long counter;

   atexit(main_exit_cleanup);
   if ((OutputFilePointer = fopen("TEST.BIN", "ab"))==NULL)
   {
        fprintf(stderr, "Error: Cannot open %s\n\r", OutputFilename);
        return (0);
   }
   file_size = 0;
   counter = 0;
   for (loop=0;;loop++)
   {
       if( file_size < (0xB0000000))
       {
          fprintf(OutputFilePointer,
              "%s%s%s%s%s%s%s%s%s%s",
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500,
                          line_length_500);
          file_size += (sizeof(line_length_500)*10);
          counter++;
          if ((counter % (1000))==0)
          {
              printf("%d\n", file_size);
          }
       }
       else
       {
           break;
       }
   }
    fclose(OutputFilePointer);
    OutputFilePointer = NULL;
    return (0);
}

Andrew

- Raw text -


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