couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Slater <nsla...@apache.org>
Subject Re: Appending "\n" and pretty printing output from the command line using curl (with a smidge of python)
Date Fri, 22 Aug 2008 11:42:05 GMT
On Fri, Aug 22, 2008 at 12:24:53AM -0500, Jason Huggins wrote:
> Hi, Noah... out of curiosity (and to further help the cause), is there an
> online reference for that rule?  Perhaps I've read too many "citation needed"
> comments in Wikipedia to let this one go. :-) I did some searching, but
> couldn't find a definitive, explicit mention.)

  3.392 Text File

  A file that contains characters organized into one or more lines. The lines do
  not contain NUL characters and none can exceed {LINE_MAX} bytes in length,
  including the <newline>.

  - http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html

  3.205 Line

  A sequence of zero or more non- <newline>s plus a terminating <newline>.

  - http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html

  Canonical Mode Input Processing

  In canonical mode input processing, terminal input is processed in units of
  lines. A line is delimited by a newline character (NL), an end-of-file character
  (EOF), or an end-of-line (EOL) character. See Special Characters for more
  information on EOF and EOL. This means that a read request will not return until
  an entire line has been typed or a signal has been received. Also, no matter how
  many bytes are requested in the read() call, at most one line will be
  returned. It is not, however, necessary to read a whole line at once; any number
  of bytes, even one, may be requested in a read() without losing information.

  - http://www.opengroup.org/onlinepubs/007908775/xbd/termios.html

Many applications choke when processing text files if last line is not properly
terminated, as your experience with the shell demonstrates.

> Also, is your patch for this available online, too? I suspect it hasn't made
> the switch into Jira (I couldn't find it there.) If not, this might be the
> motivation I need to start reading some Erlang code and try to figure out what
> to edit on my own. :-)

Nope, sorry, it's been lost to the sands of time.

The patch should be quite simple thought, even for a non-Erlang programmer.

-- 
Noah Slater, http://people.apache.org/~nslater/

Mime
View raw message