bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mapping text files


From: Paul Eggert
Subject: Re: Mapping text files
Date: Wed, 20 Sep 2006 11:54:42 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bruce Korb <address@hidden> writes:

> If valid data is supposed to be ASCII text, then what meaning
> do you give to the NUL byte?

It depends on the application.  The NUL character is valid in
ASCII.  For 'sort', for example, it participates in comparison
as the least-possible character.

> If a data file has random trash in it

I guess one person's trash is another's treasure.  I can easily see
how NUL bytes might be used by standard utilities, e.g.,
"sort -t '\0' -k 2".

> the correct response is something along the lines of EINVAL
> whenever strlen(filedata) != filestat.st_size.

The GNU coding standards disagree: they say "Utilities reading files
should not drop NUL characters".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]