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

  • Home
  • SEARCH
  • 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 7745529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:02:59+00:00 2026-06-01T10:02:59+00:00

Situation: new_pipe = os.open(pipe_path, os.O_RDONLY | os.O_NONBLOCK) # pipe_path points to a FIFO data

  • 0

Situation:

new_pipe = os.open(pipe_path, os.O_RDONLY | os.O_NONBLOCK) # pipe_path points to a FIFO
data = os.read(new_pipe, 1024)

The read occasionally raises errno -11: Resource temporarily unavailable.

When is this error raised? It seems very rare, as the common cases return data:

  • If no writer has the pipe opened, empty str (”) is returned.
  • If the writer has the pipe opened, but no data is in the fifo, empty str
    (”) is also returned
  • And of course if the writer puts data in the fifo, that data will be read.
  • 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-06-01T10:03:00+00:00Added an answer on June 1, 2026 at 10:03 am

    From the POSIX specification of the read system call (emphasis mine):

    When attempting to read from an empty pipe or FIFO:

    • If no process has the pipe open for writing, read() shall return 0 to
      indicate end-of-file.

    • If some process has the pipe open for writing and O_NONBLOCK is set,
      read() shall return -1 and set errno to [EAGAIN].

    So basically your second assumption is wrong:

    If the writer has the pipe opened, but no data is in the fifo, empty str (”) is also returned

    This would be against the specification and I can’t reproduce that behaviour on my machine (it raises EAGAIN for me). This is not a big problem however, you can just catch the exception and retry:

    import errno
    
    def safe_read(fd, size=1024):
       ''' reads data from a pipe and returns `None` on EAGAIN '''
       try:
          return os.read(fd, size)
       except OSError, exc:
          if exc.errno == errno.EAGAIN:
             return None
          raise
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am facing a new situation. I know someone definitely had faced these type
I'm new to cocos2d and my game situation is below. In top-down shooter game
I am new to JavaScript so please be understanding of my situation. I have
I'm new to collaborating with Mercurial. My situation: Another programmer changed rev 1 of
I'm new to NHibernate and Fluent NHibernate. Assuming I have a situation like the
I have situation where I need to change the order of the columns/adding new
I am new to iPhone programming, and stuck in a situation. The situation is
I am brand-spanking-new to the namespace concept in php. The situation: Multiple files in
All, I am new to Windows 7 Phone. My situation is that I have
I've got the following regex that was working perfectly until a new situation arose

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.