CVS difference for ais/ai-00248.txt

Differences between 1.24 and version 1.25
Log of other versions for file ais/ai-00248.txt

--- ais/ai-00248.txt	2005/01/07 03:07:30	1.24
+++ ais/ai-00248.txt	2005/01/28 02:10:38	1.25
@@ -550,9 +550,154 @@
 date) in a directory entry, the implementation should provide functions in a
 child package Ada.Directories.Information to retrieve it.
 
-Start_Search should raise Use_Error if Pattern is malformed, but not if it
-could represent a file in the directory but does not actually do so.
+    AARM Note:
+    For Microsoft Windows, Ada.Directories.Information should
+    contain at least the following routines:
 
+    package Ada.Directories.Information is
+        -- System specific directory information.
+        -- Windows version.
+
+        function Creation_Time (Name : in String) return Ada.Calendar.Time;
+
+        function Last_Access_Time (Name : in String) return Ada.Calendar.Time;
+
+        function Is_Read_Only (Name : in String) return Boolean;
+
+        function Needs_Archiving (Name : in String) return Boolean;
+            -- This generally means that the file needs to be backed up.
+            -- The flag is only cleared by backup programs.
+
+        function Is_Compressed (Name : in String) return Boolean;
+
+        function Is_Encrypted (Name : in String) return Boolean;
+
+        function Is_Hidden (Name : in String) return Boolean;
+
+        function Is_System (Name : in String) return Boolean;
+
+        function Is_Offline (Name : in String) return Boolean;
+
+        function Is_Temporary (Name : in String) return Boolean;
+
+        function Is_Sparse (Name : in String) return Boolean;
+
+        function Is_Not_Indexed (Name : in String) return Boolean;
+
+        function Creation_Time (Directory_Entry : in Directory_Entry_Type)
+             return Ada.Calendar.Time;
+
+        function Last_Access_Time (Directory_Entry : in Directory_Entry_Type)
+             return Ada.Calendar.Time;
+
+        function Is_Read_Only (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Needs_Archiving (Directory_Entry : in Directory_Entry_Type) return Boolean;
+            -- This generally means that the file needs to be backed up.
+            -- The flag is only cleared by backup programs.
+
+        function Is_Compressed (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Encrypted (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Hidden (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_System (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Offline (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Temporary (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Sparse (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Not_Indexed (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        -- Additional implementation-defined subprograms allowed here.
+
+    end Ada.Directories.Information;
+
+
+    For Unix-like systems (POSIX, Linux, etc.), Ada.Directories.Information
+    should contain at least the following routines:
+
+    package Ada.Directories.Information is
+        -- System specific directory information.
+        -- Unix version.
+
+        function Last_Access_Time (Name : in String) return Ada.Calendar.Time;
+
+        function Last_Status_Change_Time (Name : in String) return Ada.Calendar.Time;
+
+        type Permission is
+          (Others_Execute, Others_Write, Others_Read,
+           Group_Execute,  Group_Write,  Group_Read,
+           Owner_Execute,  Owner_Write,  Owner_Read,
+           Set_Group_ID,   Set_User_ID);
+
+        type Permission_Set_Type is array (Permission) of Boolean;
+
+        function Permission_Set (Name : in String) return Permision_Set_Type;
+
+        function Owner (Name : in String) return String;
+            -- Returns the image of the User_Id. If a definition of User_Id
+	    -- is available, an implementation-defined version of Owner
+	    -- returning User_Id should also be defined.
+
+        function Group (Name : in String) return String;
+            -- Returns the image of the User_Id. If a definition of Group_Id
+	    -- is available, an implementation-defined version of Group
+	    -- returning Group_Id should also be defined.
+
+        function Is_Block_Special_File (Name : in String) return Boolean;
+
+        function Is_Character_Special_File (Name : in String) return Boolean;
+
+        function Is_FIFO (Name : in String) return Boolean;
+
+        function Is_Symbolic_Link (Name : in String) return Boolean;
+
+        function Is_Socket (Name : in String) return Boolean;
+
+        function Last_Access_Time (Directory_Entry : in Directory_Entry_Type)
+           return Ada.Calendar.Time;
+
+        function Last_Status_Change_Time (Directory_Entry : in Directory_Entry_Type)
+           return Ada.Calendar.Time;
+
+        function Permission_Set (Directory_Entry : in Directory_Entry_Type)
+           return Permission_Set_Type;
+
+        function Owner (Directory_Entry : in Directory_Entry_Type) return String;
+           -- See Owner above.
+
+        function Group (Directory_Entry : in Directory_Entry_Type) return String;
+           -- See Group above.
+
+        function Is_Block_Special_File (Directory_Entry : in Directory_Entry_Type)
+           return Boolean;
+
+        function Is_Character_Special_File (Directory_Entry : in Directory_Entry_Type)
+           return Boolean;
+
+        function Is_FIFO (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        function Is_Symbolic_Link (Directory_Entry : in Directory_Entry_Type)
+           return Boolean;
+
+        function Is_Socket (Directory_Entry : in Directory_Entry_Type) return Boolean;
+
+        -- Additional implementation-defined subprograms allowed here.
+
+    end Ada.Directories.Information;
+
+    We give these definitions to give guidance so that every implementation
+    for a given target is not unnecessarily different. Implementers are
+    encouraged to make packages for other targets as similar to these as
+    possible.
+
+Start_Search and Search should raise Use_Error if Pattern is malformed, but not
+if it could represent a file in the directory but does not actually do so.
+
 For Rename, if both New_Name and Old_Name are simple names, then Rename should
 not propagate Use_Error.
 
@@ -1075,7 +1220,8 @@
     Directory : @b<in> String;
     Pattern : @b<in> String;
     Filter : @b<in> Filter_Type := (others =@> True);
-    Process : @b<not null access procedure> (Directory_Entry : @b<in> Directory_Entry_Type));>
+    Process : @b<not null access procedure>
+      (Directory_Entry : @b<in> Directory_Entry_Type));>
 @xindent<Searches in the directory entry in the directory named by Directory,
 calling the subprogram designated by Process passing each entry matching
 Pattern. Pattern represents a file name matching
@@ -1097,17 +1243,20 @@
 implementation-defined. The exception Status_Error is propagated if
 Directory_Entry is invalid.>
 
-@xcode<@b<function> Full_Name (Directory_Entry : @b<in> Directory_Entry_Type) @b<return> String;>
+@xcode<@b<function> Full_Name (Directory_Entry : @b<in> Directory_Entry_Type)
+     @b<return> String;>
 @xindent<Returns the full external name of the external file (including
 directories) represented by Directory_Entry. The format of the name returned is
 implementation-defined. The exception Status_Error is propagated if
 Directory_Entry is invalid.>
 
-@xcode<@b<function> Kind (Directory_Entry : @b<in> Directory_Entry_Type) @b<return> File_Kind;>
+@xcode<@b<function> Kind (Directory_Entry : @b<in> Directory_Entry_Type)
+     @b<return> File_Kind;>
 @xindent<Returns the kind of external file represented by Directory_Entry. The
 exception Status_Error is propagated if Directory_Entry is invalid.>
 
-@xcode<@b<function> Size (Directory_Entry : @b<in> Directory_Entry_Type) @b<return> File_Size;>
+@xcode<@b<function> Size (Directory_Entry : @b<in> Directory_Entry_Type)
+     @b<return> File_Size;>
 @xindent<Returns the size of the external file represented by Directory_Entry.
 The size of an external file is the number of stream elements contained in
 the file. If the external file is discontiguous (not all elements exist), the
@@ -1140,8 +1289,8 @@
 date) in a directory entry, the implementation should provide functions in a
 child package Ada.Directories.Information to retrieve it.
 
-Start_Search should raise Use_Error if Pattern is malformed, but not if it
-could represent a file in the directory but does not actually do so.
+Start_Search and Search should raise Use_Error if Pattern is malformed, but not
+if it could represent a file in the directory but does not actually do so.
 
 For Rename, if both New_Name and Old_Name are simple names, then Rename should
 not propagate Use_Error.

Questions? Ask the ACAA Technical Agent