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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d93b7c6dd17cbc81 X-Google-Attributes: gid103376,public From: Hyman Rosen Subject: Re: Strings and reading from a file Date: 1999/05/13 Message-ID: #1/1 X-Deja-AN: 477583134 Sender: hymie@calumny.jyacc.com References: <7han2q$jkp$1@news.iinet.net.au> <37399913.BD928DD1@pwfl.com> <7hevh1$g08$1@nnrp1.deja.com> <7hf2bc$imm$1@nnrp1.deja.com> <7hf611$16i$1@cnn.Princeton.EDU> <373B271F.EA28F9C8@pwfl.com> X-Complaints-To: abuse@panix.com X-Trace: news.panix.com 926633693 24224 209.49.126.226 (13 May 1999 22:14:53 GMT) Organization: PANIX Public Access Internet and UNIX, NYC NNTP-Posting-Date: 13 May 1999 22:14:53 GMT Newsgroups: comp.lang.ada Date: 1999-05-13T22:14:53+00:00 List-Id: Marin David Condic writes: > However - enamoured as I am with the "perfect" solution that works for > any case that may arise - I'd wonder if in practice it isn't a bit of > overkill. No, it's not. One of the most annoying things about the old, pre-GNU UNIX utilities were the plethora of built-in line limitations they had. It is in the exceptional situations where you most need your tools working properly. If the tools silently discard lines which are too long, or divide them into several lines, or crash, or die with an exception, that's a very bad thing. For example, my .newsrc file, which is a plain text file, has some very long lines in it. I have a little awk script which finds the widest line in a file. On Solaris, nawk aborts with nawk: input record `comp.lang.c++! 63853...' too long On Linux, everything runs fine, and I discover that the longest line, for comp.lang.c++, is 27530 characters long! If you find yourself fighting the language in order to handle input of arbitrary size, then it's a problem of the language. I know that it's not much of an issue in C++, and I would guess it's not much of an issue in Ada either. Limiting input to the size of a fixed buffer is just laziness or incompetence.