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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.xdsl-213-196-221-111.netcologne.de!not-for-mail From: Frank Buss Newsgroups: comp.lang.ada Subject: Re: quiz for Sequential_IO Read Date: Sun, 3 Sep 2017 22:10:25 +0200 Organization: news.netcologne.de Distribution: world Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 3 Sep 2017 20:10:25 +0000 (UTC) Injection-Info: newsreader4.netcologne.de; posting-host="xdsl-213-196-221-111.netcologne.de:213.196.221.111"; logging-data="28570"; mail-complaints-to="abuse@netcologne.de" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:47921 Date: 2017-09-03T22:10:25+02:00 List-Id: On 09/03/2017 07:28 PM, J-P. Rosen wrote: > Le 03/09/2017 à 13:01, Frank Buss a écrit : >> The content of test.txt is just the ASCII string "hello": > If it is a text file, it is not appropriate for Sequential_IO which > requires a binary file. It was just an example, and I posted the binary content of the file for clarification as well. > In every language, the format of a binary file is known only to the > compiler (I remember having been warned about this when I learned > FORTRAN - a long time ago); the purpose of these files is to save data, > then reread them from the same program, or at least the same language > with the same compiler. This is nonsense. There are a lot of binary file specifications and of course it should be possible to read and write these files, independent of the programming language or the compiler. Imagine files like PNG would only work, if you write/read them with a program, which was compiled with exact the same compiler. > It may happen that the compiler just outputs the raw binary > representation, but you have absolutely no guarantee about that. Any programming language implementation which doesn't provide exact binary input/output is unusable. It might be fine for some rare cases, where you need it only in the same program that the binary representation doesn't matter (e.g. temporary cache files etc.), but usually you want to have control over the format and you want to know the format. -- Frank Buss, http://www.frank-buss.de electronics and more: http://www.youtube.com/user/frankbuss