From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,136a2b49b817b53c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-04 22:10:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.stealth.net!news-east.rr.com!news.rr.com!wn2feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail From: "David Thompson" Newsgroups: comp.lang.ada References: Subject: Re: Binary Data File - PLEASE HELP X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: <05Ty6.8994$IJ1.762798@bgtnsc05-news.ops.worldnet.att.net> Date: Thu, 05 Apr 2001 05:08:12 GMT NNTP-Posting-Host: 12.89.135.68 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 986447292 12.89.135.68 (Thu, 05 Apr 2001 05:08:12 GMT) NNTP-Posting-Date: Thu, 05 Apr 2001 05:08:12 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:6494 Date: 2001-04-05T05:08:12+00:00 List-Id: Sergio wrote : > Ada simply cannot do that, sorry. ... > > void WorkFile(char *fileName) > > { > > char Buffer[4096]; > > FILE *handle; > > > > handle = fopen(fileName, "r"); > > while (!feof(handle)) > > { > > fread(handle, 4096, 1, buffer); /* Read data from file to buffer > */ > > Work(Buffer); /* ... do some work with such data */ > > } > > } Not quite. Aside from the fact that your fread() arguments are backwards (and any conforming C compiler is required to diagnose it if you #include'd stdio.h as you should) -- Ada does make it _more difficult_ to incorrectly process garbage (or crash!) if the input file is empty or nonexistent, or process the last block twice otherwise. I suspect the more serious answers already given are what you intended to ask though. -- - David.Thompson 1 now at worldnet.att.net