TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BOB STOUT
from: JOE DUNFORD
date: 1997-09-27 07:33:00
subject: read more than 64k

BS> > I think I sure %subj% is impossible if you're writing for DOS. 'Cos C 
use
BS> > DOS service (int 21h) whitch CANNOT read more than 64k at a time. UC 
this
BS> > is because of restrictions ``unsigned int'' type.
BS>  While the basic answer here is correct, it doesn't mean you can't hide 
the
BS>details from a calling program. For example, in SNIPPETS
BS>there is a file called HUGEREAD.C which implements reading
BS>and writing of huge data to/from either standard C or
BS>Posix streams. Implementing similar code in C++ would be
BS>trivial.
I'm not sure that the basic answer is correct. I admit I've only glanced
at HUGEREAD.C but it seems to me that it is for shuffling around large
blocks of memory(overcoming the offset limit), and not for "reading"
from a file.
BS>  A more significant question is the desire to read or write "12-13 Mb". 
o
BS>do this would require that the program operate in one of
BS>the x86's 32-bit modes, which would require double
BS>buffering to accomodate the underlying restrictions of
BS>real-mode DOS. The most basic question, of course, is do
BS>you physically have that much memory free?!?
I'm afraid I don't follow you. When you say double buffering do you mean
some sort of windowing scheme ? If you are using a good compiler that
supports good extenders then reading a 12-13 Mb file would be as simple
as:

cTemp=malloc (13*1024*1024);
fread (&cTemp,13*1024*1024,1,FHandle);
As for memory, I agree. 12-13Mb is a pretty hefty requirement. ;)
___
 þ SLMR 2.1a þ If this were an actual tagline, it would be funny.
--- Maximus 3.01
---------------
* Origin: C+Net BBS. Programming & Networking. (1:342/1017)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.