Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6156889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:41:25+00:00 2026-05-23T20:41:25+00:00

i have a construct like the following: os.mkfifo(‘pipe.tmp’) enc = Popen([‘encoder’, ‘-i’, ‘pipe.tmp’]) cap

  • 0

i have a construct like the following:

os.mkfifo('pipe.tmp')
enc = Popen(['encoder', '-i', 'pipe.tmp'])
cap = Popen(['capture', '-f', 'pipe.tmp'])

here cap is a process which normally writes to a file (specified by -f), but i can get it to spew data to the screen by supplying /dev/stdout as the output file. similarly, enc expects to read from a file-like object, and i am able to get it to read from pipe by supplying - as the input. so instead of using a named pipe in the os, i thought the special file may not be necessary, i can use an unnamed pipe like this..

cap = Popen(['capture', '-f', '/dev/stdout'], stdout=PIPE)
enc = Popen(['encoder', '-i', '-'], stdin=cap.stdout)
cap.stdout.close()

(note also the reversal of order of spawning). i like this better because a temporary file seems unnecessary, but i am a bit concerned about whether this construct will chain the processes in the way i expect.

  1. is the /dev/stdout that cap is talking to distinct from the actual stdout in the OS? that is, with the input pipe - in enc will i get a clean channel of data between these two processes even if other processes are chatting away to /dev/stdout on the OS?
  2. will there be any significant differences in behaviour with blocking/queuing ? i think in my first example the named pipe will be a buffered 4096 bytes, and will block at either end if cap/enc aren’t writing/reading fast enough, but correct me if i’m wrong.
  3. is any special order of spawning or termination required, or any other gotchas i should be aware of?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:41:26+00:00Added an answer on May 23, 2026 at 8:41 pm
    1. /dev/stdout gives you the stdout for the current process, so you should be just fine to use that. (there isn’t really anything ‘global’ about /dev/stdout)
    2. The size of the fifo in the first example depends on the configuration of your system (I’m not sure how to change that). But subprocess.Popen allows you to define the buffer size for its I/O operations, so you should be able to tune that. Update: a little more research in, I have found there is a 64kB limit to the pipes that is not affected by the bufsize argument. Not sure how to get around that (except to read more frequently and handle the buffering manually)
    3. For your second example, it looks like you are required to start in the order you gave, since you need cap.stdout to be available before starting enc. Alternatively, you could leave the two processes disconnected and handle the communication between them manually.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an enum construct like this: public enum EnumDisplayStatus { None = 1,
I have a polygon soup of triangles that I would like to construct a
I'd like to use the following idiom, that I think is non-standard. I have
I have a smart pointer type, and would like to construct an object that
I have the following construct: type Foo struct { Bar func(foo *Foo) bool }
So I have the following which errors out but it seems like php should
I have the following SQL query - SELECT * FROM dbo.LocalContacts WHERE name LIKE
I have a constructor like as follows: public Agent(){ this.name = John; this.id =
Ought I to unit test constructors? Say I have a constructor like this: IMapinfoWrapper
I have a varargs constructor like this : public class Sentence { public String[]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.