-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System; use System;
+with System.Communication; use System.Communication;
with System.File_IO;
with System.Soft_Links;
with System.CRTL;
function End_Of_File (File : File_Type) return Boolean is
begin
FIO.Check_Read_Status (AP (File));
- return Count (File.Index) > Size (File);
+ return File.Index > Size (File);
end End_Of_File;
-----------
function Index (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
- return Count (File.Index);
+ return File.Index;
end Index;
-------------
-- (and furthermore there are situations (such as the case of writing
-- a sequential Posix FIFO file) where the lseek would cause problems.
- if Mode = Out_File then
- File.Last_Op := Op_Write;
- else
- File.Last_Op := Op_Read;
- end if;
+ File.Last_Op := (if Mode = Out_File then Op_Write else Op_Read);
end Open;
----------
end if;
File.Index := File.Index + Count (Nread);
- Last := Item'First + Stream_Element_Offset (Nread) - 1;
File.Last_Op := Op_Read;
+ Last := Last_Index (Item'First, Nread);
end Read;
-- This version of Read is the primitive operation on the underlying