From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_MSGID, PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2bc1c4ca7f04be6 X-Google-Attributes: gid103376,public From: randhol+abuse@pvv.org (Preben Randhol) Subject: Re: GNAT bug or expectations problem with Text_Io.Text_Streams Date: 2000/09/24 Message-ID: #1/1 X-Deja-AN: 673490999 References: <8qjmp5$189$1@pyrite.mv.net> X-Complaints-To: usenet@itea.ntnu.no X-Trace: kopp.stud.ntnu.no 969800571 28854 129.241.83.82 (24 Sep 2000 13:02:51 GMT) Organization: Norwegian university of science and technology User-Agent: slrn/0.9.6.2 (Linux) NNTP-Posting-Date: 24 Sep 2000 13:02:51 GMT Newsgroups: comp.lang.ada Date: 2000-09-24T13:02:51+00:00 List-Id: On Sun, 24 Sep 2000 10:40:31 GMT, David C. Hoos, Sr. wrote: >That said, the observed behavior seems to me to violate RM A 12.2 (34), >viz.: >"The ability to obtain a stream for a text file allows Current_Input, >Current_Output, and Current_Error to be processed with the functionality >of streams, including the mixing of text and binary input-output, and the >mixing of binary input-output for different types." After looking in the Gnat 3.13p source code I found this: a-textio.adb: -- This is the primitive Stream Write routine, used when a -- Text_IO file is treated directly as a stream using -- Text_IO.Streams.Stream. procedure Write [...] -- Now we do the write. Since this is a text file, it is normally in -- text mode, but stream data must be written in binary mode, so we -- temporarily set binary mode for the write, resetting it after. -- These calls have no effect in a system (like Unix) where there is -- no distinction between text and binary files. set_binary_mode (fileno (File.Stream)); i-cstrea.ads: procedure set_binary_mode (handle : int); i-cstrea.ads: pragma Import (C, set_binary_mode, "set_binary_mode"); -- Preben Randhol - Ph.D student - http://www.pvv.org/~randhol/ "i too once thought that when proved wrong that i lost somehow" - i was hoping, alanis morisette