CVS difference for ais/ai-00283.txt

Differences between 1.4 and version 1.5
Log of other versions for file ais/ai-00283.txt

--- ais/ai-00283.txt	2002/01/24 04:54:13	1.4
+++ ais/ai-00283.txt	2002/02/05 02:06:24	1.5
@@ -198,3 +198,136 @@
 
 *************************************************************
 
+From: Randy Brukardt
+Date: Monday, February  4, 2002  7:56 PM
+
+You may recall that back in December, I created and distributed a test to
+determine the current behavior of Ada compilers when closing or resetting a
+stream file with mode Out_File. Here is the promised summary of the
+results -- they're pretty grim in that compilers are very inconsistent, even
+compilers from the same vendor.
+
+I received results from most of the compiler vendors, but I didn't receive
+results from DDCI or from ICC, despite repeated requests. All other
+compilers are listed in alphabetical order of the product name.
+
+Aversomething AdaMagic (latest development version):
+
+   -- Truncates sequential-access stream files on close/reset: No.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: No.
+   -- Supports Set_Mode "workaround" to avoid truncation: Yes.
+   -- Truncates positional-access stream files on close/reset: No.
+   -- Discards data on Open for Out_File for positional-access stream files: No.
+   -- No Truncation.
+   -- File opened with mode Append_File truncates after positioning and writing in middle:
+		Positioning not allowed.
+
+Rational Apex for Sun Solaris (latest development version):
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: Yes.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+   -- Truncates positional-access stream files on close/reset: Yes.
+   -- Discards data on Open for Out_File for positional-access stream files: Yes (very bad).
+   -- Truncation is at the largest position element written.
+   -- File opened with mode Append_File truncates after positioning and writing in middle: No.
+   --    (This implementation appears to violate AI-85 by allowing positioning,
+   --	  but ignoring the result and writing at the end anyway.)
+
+Rational Apex for Windows NT (3.2.0c):
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: No.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+   -- Truncates positional-access stream files on close/reset: Yes.
+   -- Discards data on Open for Out_File for positional-access stream files: No.
+   -- Truncation is at the largest position element written.
+   -- File opened with mode Append_File truncates after positioning and writing in middle: No.
+   (Implementation incorrectly raises End_Error when reading past the end of the file
+    with Stream_IO.Read)
+
+GNAT for Sun Solaris (latest development version):
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: No.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+   -- Truncates positional-access stream files on close/reset: Yes.
+   -- Discards data on Open for Out_File for positional-access stream files: Yes (very bad).
+   -- Truncation is at the largest position element written.
+   -- File opened with mode Append_File truncates after positioning and writing in middle: No.
+
+GNAT for Windows NT (3.14a1):
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: No.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+   -- Truncates positional-access stream files on close/reset: Yes.
+   -- Discards data on Open for Out_File for positional-access stream files: Yes (very bad).
+   -- Truncation is at the largest position element written.
+   -- File opened with mode Append_File truncates after positioning and writing in middle: No.
+
+Janus/Ada for Windows NT (3.1.2 development)
+
+   -- Truncates sequential-access stream files on close/reset: No.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: No.
+   -- Supports Set_Mode "workaround" to avoid truncation: Yes.
+   -- Truncates positional-access stream files on close/reset: No.
+   -- Discards data on Open for Out_File for positional-access stream files: No.
+   -- No Truncation.
+   -- File opened with mode Append_File truncates after positioning and writing in middle: No.
+
+Aonix ObjectAda for Sun Solaris (version 7.2.1)
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: Yes.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+   -- Truncates positional-access stream files on close/reset: Yes (bizarre behavior: truncates
+         to the number of elements written, ignoring the positioning
+         --  except for the basic case of immediate Close after writing, which
+         works as expected)).
+   -- Discards data on Open for Out_File for positional-access stream files: Yes (very bad).
+   -- Can't tell truncation point (due to bizarre behavior).
+   -- File opened with mode Append_File truncates after positioning and writing in middle: No.
+   --    (This implementation appears to violate AI-85 by allowing positioning,
+   --     but ignoring the result and writing at the end anyway.)
+
+Aonix ObjectAda for Windows NT (version 7.2.1)
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: Yes.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+   -- Truncates positional-access stream files on close/reset: Yes (bizarre
+         behavior: truncates to the number of elements written, ignoring the positioning).
+   -- Discards data on Open for Out_File for positional-access stream files: Yes (very bad).
+   -- Can't tell truncation point (due to bizarre behavior).
+   -- File opened with mode Append_File truncates after positioning and writing in middle: Yes.
+
+OCS PowerAda/6000 Compiler (Version 4.3)
+
+   -- Truncates sequential-access stream files on close/reset: Yes.
+   -- Truncates stream files opened with In_File mode, then Reset to Out_File: Yes.
+   -- Supports Set_Mode "workaround" to avoid truncation: No.
+         (Set_Mode unexpectedly raised Use_Error at this point [with an Exception_Message
+          of "Set_Mode not yet supported"], which terminated the test.)
+
+
+The main conclusion that can be drawn from this is that there is no
+consistency, even between the same vendor's implementations. Probably some
+sort of truncation for sequential-access files should be required (since
+most vendors do it, even though neither the AARM nor Tucker support the
+requirement), but beyond that it is very murky.
+
+OTOH, the large number of implementations that discard data when a file is
+Opened with mode Out_File (even if later access is simply an update of a few
+elements) is horrifying. It means that Stream_IO cannot be used in
+applications requiring in-place updating -- an application that was clearly
+intended by the language designers.
+
+Also, hardly any of the implementations support the workaround suggested to
+avoid truncation. So, if a user want to avoid this behavior (for in-place
+updating, for example), they're out of luck with most implementations.
+
+We'll have to discuss the best approach at the upcoming meeting.
+
+*************************************************************
+

Questions? Ask the ACAA Technical Agent