Control stript which is runing in background.

Alan Bawden alan at csail.mit.edu
Fri Jan 1 00:23:38 EST 2021


jak <nospam at please.ty> writes:

   Running the command:

   $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe

   the three texts do not mix....

The three texts do not mix as long at the contents of bible.txt is short
enough (and provided `cat' only calls `write' once).  In the POSIX
specification, the manual page for the `write' system call describes
writing to a pipe or FIFO as follows:

  Write requests of {PIPE_BUF} bytes or less shall not be interleaved
  with data from other processes doing writes on the same pipe.  Writes
  of greater than {PIPE_BUF} bytes may have data interleaved, on
  arbitrary boundaries, with writes by other processes, whether or not
  the O_NONBLOCK flag of the file status flags is set.

-- 
Alan Bawden


More information about the Python-list mailing list