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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder.news-service.com!news.mixmin.net!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Tue, 11 May 2010 09:56:43 +0200 Organization: Ada At Home Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> <84r4k5Ftk8U1@mid.individual.net> <84sfkjF3btU1@mid.individual.net> NNTP-Posting-Host: HK74FprowBoHhCYVD5Tsvg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:11483 Date: 2010-05-11T09:56:43+02:00 List-Id: Le Tue, 11 May 2010 09:34:42 +0200, Niklas Holsti = a =E9crit: > Yes, with one problem, which is that it is hard (that is, I don't know= = > how) to detect when the very last line in the input file is null. This= = > is because End_Of_Line returns true also at end of file, and End_Of_Fi= le = > returns true also when the data remaining in the file is an end-of-lin= e = > (and end-of-page) before the true end of file. One consequence is that= a = > truly empty file (like /dev/null) looks the same as a file with one nu= ll = > line (like echo ""). This may be "hard" only with the Standard_Input file, which is a = Text_IO.File_Type, and Text_IO, as previously said, is a file of lines. = A = file of line, as you shown you know, is a file where each is line strict= ly = delimited in platform dependent manner (with LF on UNIX, CR+LF on Window= s = and CR on Mac, or with specific chunks or records on some other systems)= . = So obviously, each line is expected to have an end, just like each file = = have an end, and the end of the last line is also the end of a file, if = = the file is a file of line. Just like a file of some kind of records end= s = with the end of the last record. I was to say this is a matter only with Standard_Input, and in the conte= xt = of "/dev/null" which you gave, you have no need to open "/dev/null" as a= = file of lines if have no reason to think "/dev/null" is indeed a file of= = lines. To talk about text files now : let say most of them are just = inconsistently formated, as many text files as produced by text editors,= = are not formated in the constant way : the last line oftenly lacks a = delimiter for the last line. This files are either invalid files of line= s = or else are not files of lines, depending on your requirement. If your requirements states that a line is a sequence of character = terminated by a CR+LF or an LF or a CR, then, the file you need is a fil= e = of characters, so don't open these files as file of lines, better as fil= e = of characters instead. The only remaining case is the one of the standard input. -- = No-no, this isn't an oops ...or I hope (TM) - Don't blame me... I'm just= = not lucky