1------------------------------------------------------------------------------ 2-- -- 3-- ASIS Tester And iNTerpreter (ASIStant) COMPONENTS -- 4-- -- 5-- F I L E -- 6-- -- 7-- B o d y -- 8-- -- 9-- Copyright (C) 1997-2013, Free Software Foundation, Inc. -- 10-- -- 11-- ASIStant is free software; you can redistribute it and/or modify it -- 12-- under terms of the GNU General Public License as published by the Free -- 13-- Software Foundation; either version 2, or (at your option) any later -- 14-- version. ASIStant is distributed in the hope that it will be useful, -- 15-- but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- 16-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- 17-- Public License for more details. You should have received a copy of the -- 18-- GNU General Public License distributed with GNAT; see file COPYING. If -- 19-- not, write to the Free Software Foundation, 59 Temple Place Suite 330, -- 20-- Boston, MA 02111-1307, USA. -- 21-- -- 22-- ASIStant is an evolution of ASIStint tool that was created by -- 23-- Vasiliy Fofanov as part of a collaboration between Software Engineering -- 24-- Laboratory of the Swiss Federal Institute of Technology in Lausanne, -- 25-- Switzerland, and the Scientific Research Computer Center of the Moscow -- 26-- University, Russia, supported by the Swiss National Science Foundation -- 27-- grant #7SUPJ048247, "Development of ASIS for GNAT with industry quality" -- 28-- -- 29-- ASIStant is distributed as a part of the ASIS implementation for GNAT -- 30-- (ASIS-for-GNAT) and is maintained by AdaCore (http://www.adacore.com). -- 31-- -- 32------------------------------------------------------------------------------ 33 34with Ada.Characters.Handling; 35with GNAT.OS_Lib; 36 37package body File is 38 39------------------------------------------------------------------------------ 40-- Additional functions that provide interface to GCC file system 41------------------------------------------------------------------------------ 42 43 function File_Length (Name : Wide_String) return Integer is 44 use GNAT.OS_Lib; 45 46 H : constant File_Descriptor 47 := Open_Read (Ada.Characters.Handling.To_String (Name), Text); 48 Length : Integer; 49 begin 50 Length := Integer (File_Length (H)); 51 Close (H); 52 return Length; 53 end File_Length; 54 55end File; 56