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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Annoying behavior Date: Sat, 25 Apr 2015 21:30:43 +0200 Organization: A noiseless patient Spider Message-ID: References: <47c7df1e-17c1-44cb-a455-43431f0d39cd@googlegroups.com> <85zj5wb9et.fsf@stephe-leake.org> <4b14659e-8c26-4c0a-8945-a5289740e054@googlegroups.com> <2eb67902-3df4-4e18-ac36-7580de229a2c@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 25 Apr 2015 19:29:42 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ca7205cc7eda2397a4f2215cd25aac5e"; logging-data="21125"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+H3JFuAw0qttp4IA+Q5fph6rsSEiNEfOE=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <2eb67902-3df4-4e18-ac36-7580de229a2c@googlegroups.com> Cancel-Lock: sha1:KqNac4NhvQpXvaj1dio/XhIaJ+o= Xref: news.eternal-september.org comp.lang.ada:25631 Date: 2015-04-25T21:30:43+02:00 List-Id: On 25.04.15 20:58, Laurent wrote: > The Show Invisibles isn't bad but I thought more in the direction of and not this sign which I have no idea how it is called. Probably not necessary at all but better have something you don't need than the opposite. In case you are a little familiar with a command line interface to an OS, then on a Mac, open Terminal, and cd to the directory where your files are stored. Type the "file" command and put a name of at least one file in question after the program's name. Then, type ENTER (I have here two files, both having one line with the word "Hello" on it): $ file dos.txt unix.txt dos.txt: ASCII text, with CRLF line terminators unix.txt: ASCII text $ A closer look at what is in a file is possible using the od program (octal dump) and its -c (character) switch: $ od -c dos.txt 0000000 H e l l o \r \n 0000007 $ > Which makes me wonder if it matters which line endings I use. Classic Mac is CR, Unix LF and Windows CRLF. > > Just tried it. Makes indeed a difference. Which means that if I ever wanted to port my little program to an other OS, I have to think to modify the text file. One way to distribute text files is in a ZIP: unzip programs typically feature a switch that allows automatic translation of line endings when unpacking. The unpacked text files then follow the OS's conventions. > Something which would make me search for hours to find the error in my code which is correct but it is the stupid text file which causes the problem. > > How does the Text_IO "know" which line ending to use? GNAT's Text_IO works better with lines that follow the OS's conventions for EOL.