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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:55:00+00:00 2026-05-13T15:55:00+00:00

I am using the POSIX call nftw() for traversing a directory structure. The directory

  • 0

I am using the POSIX call nftw() for traversing a directory structure. The directory structure is flat – only 4 files and no subdirectories.

However when I call nftw() a lot of times on this flat directory then I get an error message after a while:

"too many open file handles".

It turned out that this happens when the flag FTW_CHDIR is used.

Would you agree that it is a bug in the Linux implementation of nftw() ?

UPDATE

A fix is now available in the glibc repositories.

here are some links to the source code I have used for testing:

  • main.cpp: http://sourceware.org/bugzilla/attachment.cgi?id=4586&action=view
  • Makefile: http://sourceware.org/bugzilla/attachment.cgi?id=4587&action=view

UPDATE

  • MacOS-X is also hit by the bug
  • Solaris9, Solaris10 and AIX 5.3 do not have the bug
  • 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-13T15:55:00+00:00Added an answer on May 13, 2026 at 3:55 pm

    For me it looks like there is really something wrong with the nftw implementation on linux.

    I have filed a bug report, see here

    UPDATE: A fix is available in the glibc repositories now.

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

Sidebar

Related Questions

How to extract only DATABASE_NAME from this string using POSIX-style regular expressions? st <-
This post is related to: POSIX TIMER- Have multiple timers I want to call
Using POSIX threads & C++, I have an Insert operation which can only be
I'm using Posix Message Queues on Linux. Basically, I have multiple threads that receive
I built a client server application using posix shared memory and posix unnamed semaphores
I'm trying to write some code using posix threads but I'm stuck from the
I'm trying to build a client server application using POSIX shared memory and POSIX
I'm trying to extract a string from another using regex. I'm using the POSIX
What are the differences in using boost:thread, Posix Thread library and the new C++11
Specifically, I'm using the Linux command: $ find . -regextype posix-extended -regex '<some regex>'

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.