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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8f01d35116e753b6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.236.170 with SMTP id uv10mr951599pbc.4.1332998275330; Wed, 28 Mar 2012 22:17:55 -0700 (PDT) Path: z9ni13822pbe.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: xor Date: Thu, 29 Mar 2012 08:17:54 +0300 Organization: Tidorum Ltd Message-ID: <9ti9k2FjcvU1@mid.individual.net> References: <9t8mq9Fla4U1@mid.individual.net> <9t99r9F6e2U1@mid.individual.net> <4f72393e$0$6643$9b4e6d93@newsspool2.arcor-online.net> <4f7308a9$0$7625$9b4e6d93@newsspool1.arcor-online.net> <9tgqomFflrU1@mid.individual.net> Mime-Version: 1.0 X-Trace: individual.net qX9HxBIFlKLiG1ERwh9vkQw8ZIMDjDKRZ+gVm1rJWH0fE94rVN Cancel-Lock: sha1:Q0r6ZHKp7DYxHv5ujlvXqubs5So= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-03-29T08:17:54+03:00 List-Id: On 12-03-29 02:25 , Randy Brukardt wrote: > "Niklas Holsti" wrote in message > news:9tgqomFflrU1@mid.individual.net... >> On 12-03-28 18:23 , Michael Moeller wrote: > ... >>> I don't want to push your helpfulness to far, but I still don't >>> know whether there is any means to determine the size of a file >>> from within Ada other than using a C subroutine calling fstat. >> >> Two ways: >> >> - Ada.Directories.Size, given the file name. >> - Ada.Direct_IO.Size, given an open (Direct_IO) file. > > Actually, three ways: Ok, I showed two ways, but did not mean that there aren't other ways. > Ada.Stream_IO.Size, given an open (Stream_IO) file. If "positioning is not supported" for the stream file, the result of Ada.Stream_IO.Size is implementation defined. Positioning is probably supported for the kinds of files the OP uses now, but it is a bit of trap for possible future uses of the program, for example if the program is later used in a shell pipeline. A pipe probably does not support positioning. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .