[comp.bugs.sys5] file called octal 777 ?

guy@auspex.auspex.com (Guy Harris) (03/11/90)

(The answer to the final question is "yes", which is why I'm redirecting
this to "comp.bugs.sys5".)

 >But this time it shows as:
 >
 >/usr/5bin/ls -bl
 >
 >-rw-------   1 hans     ph         31181 Mar  8 11:32 \777
 >
 >I thought \777 was 511, which doesn't fit into a char.
 >Od-ing the directory shows that the file is called \377.
 >
 >Bug in ls ?

Yes.  The code that handles non-printable characters in the S5R3 "ls"
prints a backslash, followed by "'0' + (c>>6 & 07)", followed by the
next two digits, where "c", an "int", is the character in question.  The
astute reader can tell what is wrong with the expression used to
generate the character printed after the backslash (at least on machines
that don't have 9-bit bytes :-))....

It's not fixed in S5R3.1, either (although '\377' *is* printable in ISO
Latin #1, and S5R3.1 supports some internationalization stuff so with
the right terminal this isn't a problem; the same is true of SunOS 4.1
:-)).