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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.70.39.106 with SMTP id o10mr7095476pdk.6.1429992803179; Sat, 25 Apr 2015 13:13:23 -0700 (PDT) X-Received: by 10.140.107.69 with SMTP id g63mr48401qgf.31.1429992802923; Sat, 25 Apr 2015 13:13:22 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!l13no10049943iga.0!news-out.google.com!k20ni1075qgd.0!nntp.google.com!z60no3715976qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 25 Apr 2015 13:13:22 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.240.246.10; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 87.240.246.10 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0ddcdd13-c29c-46e2-b516-3cc26a964d6e@googlegroups.com> Subject: Re: Annoying behavior From: Laurent Injection-Date: Sat, 25 Apr 2015 20:13:22 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:192938 Date: 2015-04-25T13:13:22-07:00 List-Id: On Saturday, April 25, 2015 at 9:30:43 PM UTC+2, Georg Bauhaus wrote: > 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. I rarely use the terminal. Changing the path in my .profile and hunting invisible files. Running my little programs which read in txt files because otherwise the file won't be found. The automatic translation by the unzip is good to know. Have read the man pages for both commands. Didn't know that storing text in files is so complicated. Thanks for this info. Laurent