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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d4101555aa2cd72c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.106.73 with SMTP id gs9mr723480wib.2.1362276833481; Sat, 02 Mar 2013 18:13:53 -0800 (PST) Path: bp2ni69216wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: reading from a pipe Date: Wed, 27 Feb 2013 20:39:11 +0100 Organization: cbb software GmbH Message-ID: <1uyugjda6ajzz$.sn0mr1zhw5ws$.dlg@40tude.net> References: <8975ebc3-3198-43e6-be68-f3e2ee84bc37@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: TNGw0NoNrWqwYmfxAaSXHQ.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-02-27T20:39:11+01:00 List-Id: On Wed, 27 Feb 2013 09:36:32 -0800 (PST), milouz wrote: > I'd like to know how to read some bytes from a pipe or some other > non-regular file such as device. I had a look at streams_io, direct_io, > etc. but was not able to code something working. > > How do we do that in Ada ? There is no Ada way of doing that, because such operations are OS-specific. Otherwise, you use the services provided by the OS at hand. E.g. under Windows you call CreateFile, then do ReadFile. These are provided by Win32Ada bindings. There are also some libraries available that provide some layer of OS abstraction, e.g. Glib. For these there exist Ada bindings as well. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de