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 uv10mr16171024pbc.4.1332950296365; Wed, 28 Mar 2012 08:58:16 -0700 (PDT) Path: z9ni11778pbe.0!nntp.google.com!news1.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: xor Date: Wed, 28 Mar 2012 18:58:14 +0300 Organization: Tidorum Ltd Message-ID: <9tgqomFflrU1@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> Mime-Version: 1.0 X-Trace: individual.net gVHq7oX0UHiX47T62CpTEg78eC+ttubwwGQA3LxXqkXM8nlRv1 Cancel-Lock: sha1:lzvSgDfss9pv0YH7svwpM3Neymw= 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-28T18:58:14+03:00 List-Id: On 12-03-28 18:23 , Michael Moeller wrote: > > > On Wed, 28 Mar 2012, Georg Bauhaus wrote: > >> On 28.03.12 14:18, Michael Moeller wrote: >> >>> While this example compiles without complaints it >>> doesn't work with procedures declared in my package. How can I >>> make Sequential_IO visible there? >> >> Instantiate Sequential_IO where you need it: [snip solution using packages and "with"] >>> Its a little strange, though, how dead easy coding concurrency >>> on a Sun machine was recently while I'm not able to write out >>> some silly bytes using the very same language. >> >> This is not unusual, I think, insofar as virtually every language >> requires some effort when I/O is more than "print". Python, >> Java, Ada, C, C++, they all have some frowned upon simple I/O procedures, >> and then the real thing. The latter takes time getting used to. [snip] > Thanks again for your quick and competent answers. This works. > > I agree with you on I/O. I've seen many languages and most often > I/O is pretty peculiar. But, from the solution that Georg gave you, it seems that your difficulty was not about I/O in Ada, but about the Ada package concept, context clauses ("with"), and perhaps generics, none of which are specifically related to I/O, and all of which you need to know anyway, in order to be productive in Ada. > 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. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .