| 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-2025, 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 |
-- As a special exception under Section 7 of GPL version 3, you are granted -- |
| 19 |
-- additional permissions described in the GCC Runtime Library Exception, -- |
| 20 |
-- version 3.1, as published by the Free Software Foundation. -- |
| 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 File_Length_Attr |
| 50 |
(FD : Integer; |
| 51 |
N : System.Address; |
| 52 |
A : access File_Attributes) return Long_Long_Integer; |
| 53 |
|
| 54 |
function Is_Regular_File_Attr |
| 55 |
(N : System.Address; |
| 56 |
A : access File_Attributes) return Integer; |
| 57 |
|
| 58 |
function Is_Directory_Attr |
| 59 |
(N : System.Address; |
| 60 |
A : access File_Attributes) return Integer; |
| 61 |
|
| 62 |
private |
| 63 |
package SOSC renames System.OS_Constants; |
| 64 |
|
| 65 |
type File_Attributes is new |
| 66 |
System.Storage_Elements.Storage_Array |
| 67 |
(1 .. SOSC.SIZEOF_struct_file_attributes); |
| 68 |
for File_Attributes'Alignment use Standard'Maximum_Alignment; |
| 69 |
|
| 70 |
pragma Import (C, Reset_Attributes, "__gnat_reset_attributes"); |
| 71 |
pragma Import (C, Error_Attributes, "__gnat_error_attributes"); |
| 72 |
pragma Import (C, File_Exists_Attr, "__gnat_file_exists_attr"); |
| 73 |
pragma Import (C, File_Length_Attr, "__gnat_file_length_attr"); |
| 74 |
pragma Import (C, Is_Regular_File_Attr, "__gnat_is_regular_file_attr"); |
| 75 |
pragma Import (C, Is_Directory_Attr, "__gnat_is_directory_attr"); |
| 76 |
|
| 77 |
end System.File_Attributes; |