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 6828051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:20:17+00:00 2026-05-26T22:20:17+00:00

Building a python fuse fs, in my readdir generator the first line of code

  • 0

Building a python fuse fs, in my readdir generator the first line of code is a print statement. This never appeared on my console. I modified it to a print to stderr as i thought it was a buffering issue. Still no output.

I added a manual flush to the next line – still nothing.

I added a time.sleep(3) to the next line, the prog does indeed sleep.

def readdir(self, path, offset):
    print >> sys.stderr, 'Text'
    sys.stderr.flush()
    time.sleep(3)

I then go on to populate the directory with other code (yield fuse.Direntry)
I do get output and can do an ls in the terminal to see the contents of my mounted fuse directory, but I want to know why the print command doesn’t work in this one generator.

Update

For those that are struggling :

def readdir(self, path, offset):
    print >> sys.stderr, 'Text'
    sys.stderr.flush()
    for o in os.listdir( "." + path ):
        yield fuse.Direntry(o)

Is the code. It generates a file list and I can move around it. That is fine.
The problem is I never see ‘Text’ appear, not in STDOUT, STDERR, anywhere.

I was simply asking why this happens only in this generator. I can put print elsewhere in the fuse code and get output very well.

  • 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-26T22:20:17+00:00Added an answer on May 26, 2026 at 10:20 pm

    Your FUSE code runs under the control of FUSE library, so you can’t be sure that stdin, stdout and stderr are the ones in your terminal session.
    It’s quite possible that the readdir generator is called with alternate std* streams.

    Since you say that other parts of your FUSE code print without any issues, you might want to prefix all print statements with a debugging log message (the value of sys.stdout.isatty() or even the repr(sys.stdout) could be handy) to help you understand what is going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a python application from some source code I've found Here I've managed
I'm building a fairly large enterprise application made in python that on its first
I am learning Python and building my first web app. I have been going
I'm building my first Python program :) However, I installed Python 3.2 instead of
Python newb and first-time poster... I'm building a mass disk copying program and have
I'm building my first python app on app-engine and wondering if I should use
I'm building a website which allows you to write python code online just like
I'm building some Python code to read and manipulate deeply nested dicts (ultimately for
Is there any IDE (like VS) with drag and drop support for building python
Building on How Do You Express Binary Literals in Python , I was thinking

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.