This is an appendix to Understanding Unix/Linux Programming written for people interested in Ada programming on POSIX systems.

Unix Systems Programming: The Big Picture

Section 1.2.1, page 2

Copy from standard input to standard output:

with Ada.Text_IO;
procedure Copy is
   use Ada.Text_IO;
   C : Character;
begin
   while not End_Of_File loop
      Get (C);
      Put (C);
   end loop;
end Copy;

Section 1.6, page 21

Here is a first draft of more: more01.adb

Compile and run it like this:

% gnatmake more01
% ./more01 more01.adb
% ls /bin | ./more01

Compare with the system version of more:

% more more01.adb
% ls /bin | more

Section 1.6, page 24

With this new knowledge, we can enhance more01.adb to more02.adb: more02.adb

Compile and test this version:

% gnatmake more02
% ls /bin | ./more02

-- 

Go to next chapter.

Collected examples:
posix-in-ada.zip
Based on:
Understanding Unix/Linux Programming, Bruce Molay, ISBN 0-13-008396-8.
Main page:
http://edb.jacob-sparre.dk/Posix_in_Ada/
Written by:
Jacob Sparre Andersen.
Latest update:
19th of April, 2008