help-bash
[Top][All Lists]
Advanced

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

Re: Process substitution documentation request


From: Chet Ramey
Subject: Re: Process substitution documentation request
Date: Wed, 24 Jun 2026 17:14:33 -0400
User-agent: Mozilla Thunderbird

On 6/18/26 4:02 PM, Borden via wrote:

"its input or output appears as a filename. This filename is passed as an
argument to the current command as the result of the expansion."

So, if what you're saying is correct, I don't think I'm completely unreasonable
in believing that I could swap a pipe name into a filename field (AKA
everything in Unix is a file).

Not everythng in Unix is a file, and not every object that can be referred
to by a pathname is a file. Devices, directories, named pipes, sockets,
symlinks, and regular files can all be referred to by a pathname.

(This is why I prefer the term "pathname" to "filename", but the GNU
documentation standards require "filename".)

Lots of other people on the Internet (and
there's no point calling them out) describe named pipes and file handlers as
largely interchangeable.

Pipes are different from files, and sometimes those differences, well, make
a difference.

Pipes have fixed capacity and blocking behavior, produce different errors
when you open a pipe for reading with no writer and vice versa, and are not
seekable. They have no size; most implementations return 0 in st_size when
interrogated using fstat(2).

These are fundamental properties of pipes.

If the application you're writing or using doesn't care about these
differences, you can use named pipes and regular files interchangably.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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