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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:47:24+00:00 2026-05-11T11:47:24+00:00

how to find a loop in the file system in Linux? i am indexing

  • 0

how to find a loop in the file system in Linux? i am indexing all files for making search fast(O(1))… i am using c programming language to implement by using the library functions in dir.h…. I can scan through entire file system but it goes in a loop if there is loop in the filesystem(example loop mount)… how to find the loop in file system.. i have seen updatedb command reporting when there is loop in file system… i don’t understand the logic… can anyone pls help find solution for this?

  • 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. 2026-05-11T11:47:25+00:00Added an answer on May 11, 2026 at 11:47 am

    I found this interesting comment here about finding loops in a DAG:

    Steinar H. Gunderson wrote:

    On Thu, 26 Feb 2004 00:28:32 +0100, Orlondow wrote:

    …also reproduced in the Cormen-Leiserson-Rivest, IIC. Which is easiest to find.

    Yes, I actually have Cormen et al, but it never struck me to look up ‘strongly connected components’ when I wanted cycle detection. Thanks, I’ll have a look at it. 🙂

    To find a cycle in a directed graph (you don’t care which cycle) as long as there exists one, you don’t need to go overboard with SCC. Plain old depth first search DFS (in the same chapter of CLRS) is enough.

    So, roughly speaking, while you are traversing the directory tree, create a DAG which represents the structure of the tree with the data at the node refering to the inode of the file. Then, you just check to make sure you don’t visit a node more than once.

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

Sidebar

Ask A Question

Stats

  • Questions 400k
  • Answers 400k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Personally, I wouldn't extend the FileSystemWatcher, but have it as… May 15, 2026 at 4:09 am
  • Editorial Team
    Editorial Team added an answer You can add a mapping for all requests with the… May 15, 2026 at 4:09 am
  • Editorial Team
    Editorial Team added an answer You can call close() from another thread, and the accept()… May 15, 2026 at 4:09 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.