|
To design the perfect anti-Unix, discard or bypass memory management so that a runaway
process can crash, subvert, or corrupt any running program. Have weak or nonexistent
privilege groups, so users can readily alter each others' files and the system's critical data.
And trust large volumes of code, like the entire shell and GUI, so that any bug or successful
attack on that code becomes a threat to the entire system.
File attributes and record structures
Unix files have neither record structure nor attributes. In some operating systems, files have
an associated record structure; the operating system (or its service libraries) knows about files
with a fixed record length, or about text line termination and whether CR/LF is to be read as a
single logical character.
In other operating systems, files and directories can have name/attribute pairs associated with
them 鈥 out-of band data used (for example) to associate a document file with an application
that understands it. (The classic Unix way to handle these associations is to have applications
recognize 鈥榤agic numbers鈥, or other type data in-band of the file.)
OS-level record structures are generally an optimization hack, and do little more than
complicate APIs and programmers' lives. They encourage the use of opaque record-oriented
file formats that generic tools like text editors cannot read properly.
File attributes can be useful, but (as we will see in Chapter 18 (Futures)) can raise some
awkward semantic issues in a world of byte-stream-oriented tools and pipes. When file
attributes are supported at the operating-system level, they predispose programmers to use
opaque formats and lean on the file attributes to tie them to the specific applications that
interpret them.
To design the perfect anti-Unix, have a cumbersome set of record structures that make it a hit-
or-miss proposition whether any given tool will be able to even read a file as the writer
intended it. Add file attributes and have the system depend on them heavily, so that the
semantics of a file will not be determinable by looking at its in-band data.
Binary file formats
If your operating system uses binary formats for critical data (such as user-account records) it
is likely that no tradition of readable textual formats for applications will develop. We explain
in more detail why this is a problem in Chapter 5 (Textuality). For now it's sufficient to note
|