.
Last update: 1997-05-20
9945-2-08
Class: No change.
_____________________________________________________________________________
Topic: sort
Relevant Sections: 2.9.1.4
Defect Report:
-----------------------
In Section 2.9.1.4 - File Read, Write, and Creation, the
standard states that:
When an attempt is made to create a file that
already exists, the action shall depend on the
file type:
(1) For directories and FIFO special files,
the attempt shall fail and the utility
shall either continue with its operation
or exit immediately with a nonzero
status, depending on the description of
the utility.
[Draft 12 of ISO/IEC 9945-2:1993 (July 1992), p. 96, lines
3433-3437]
Does the standard really mean what it says? Will every
utility that creates an output file need to first check that
there is not a file of type FIFO with that name before it
open()s it for writing?
If so, ``mkfifo foo; sort -o foo file'' will fail. Being
able to use a FIFO as a pipe with a name is a useful
behaviour. It allows applications to connect utilities
together in more complex ways than simple pipelines.
WG15 response for 9945-2:1993
-----------------------------------
The quoted text from Section 2.9.1.4 is modified by Section 2.9.1, lines
3360-3361 "Utility and function description statements override these
defaults when appropriate."
The sort -o option is described in the Output Files section as "If the
-o option is in effect, the sorted output shall be placed in the
file..". This overrides section 2.9.1.4, requiring that the output be
placed in the file, as it does not speak of requiring creation of said
file.
Rationale for Interpretation:
-----------------------------
None.
_____________________________________________________________________________