File : s-filatt.ads


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                         GNAT RUN-TIME COMPONENTS                         --
   4 --                                                                          --
   5 --                S Y S T E M . F I L E _ A T T R I B U T E S               --
   6 --                                                                          --
   7 --                                 S p e c                                  --
   8 --                                                                          --
   9 --             Copyright (C) 2013, Free Software Foundation, Inc.           --
  10 --                                                                          --
  11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  12 -- terms of the  GNU General Public License as published  by the Free Soft- --
  13 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
  14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  16 -- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
  17 --                                                                          --
  18 --                                                                          --
  19 --                                                                          --
  20 --                                                                          --
  21 --                                                                          --
  22 -- You should have received a copy of the GNU General Public License and    --
  23 -- a copy of the GCC Runtime Library Exception along with this program;     --
  24 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
  25 -- <http://www.gnu.org/licenses/>.                                          --
  26 --                                                                          --
  27 -- GNAT was originally developed  by the GNAT team at  New York University. --
  28 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
  29 --                                                                          --
  30 ------------------------------------------------------------------------------
  31 
  32 --  This package provides a binding to the GNAT file attribute query functions
  33 
  34 with System.OS_Constants;
  35 with System.Storage_Elements;
  36 
  37 package System.File_Attributes is
  38 
  39    type File_Attributes is private;
  40 
  41    procedure Reset_Attributes (A : access File_Attributes);
  42 
  43    function Error_Attributes (A : access File_Attributes) return Integer;
  44 
  45    function File_Exists_Attr
  46      (N : System.Address;
  47       A : access File_Attributes) return Integer;
  48 
  49    function Is_Regular_File_Attr
  50      (N : System.Address;
  51       A : access File_Attributes) return Integer;
  52 
  53    function Is_Directory_Attr
  54      (N : System.Address;
  55       A : access File_Attributes) return Integer;
  56 
  57 private
  58    package SOSC renames System.OS_Constants;
  59 
  60    type File_Attributes is new
  61      System.Storage_Elements.Storage_Array
  62        (1 .. SOSC.SIZEOF_struct_file_attributes);
  63    for File_Attributes'Alignment use Standard'Maximum_Alignment;
  64 
  65    pragma Import (C, Reset_Attributes,     "__gnat_reset_attributes");
  66    pragma Import (C, Error_Attributes,     "__gnat_error_attributes");
  67    pragma Import (C, File_Exists_Attr,     "__gnat_file_exists_attr");
  68    pragma Import (C, Is_Regular_File_Attr, "__gnat_is_regular_file_attr");
  69    pragma Import (C, Is_Directory_Attr,    "__gnat_is_directory_attr");
  70 
  71 end System.File_Attributes;