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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:04:43+00:00 2026-05-28T16:04:43+00:00

Developing search utility to search a file entire computer system, works fine on windows

  • 0

Developing search utility to search a file entire computer system, works fine on windows platform but becomes an infinite process in ubuntu linux. Please help to overcome this flaw. The following is the main part of the code.

public static void fun(File f){  // root directory is passed as argument
try{
   if(f.isDirectory()){
       File [] fi=f.listFiles();
       for(int i=0;i<fi.length;i++){
           if(fileFound==true) break;   // fileFound is boolean data type used as flag to indicate whether the file is found or not
           System.out.println(fi[i].getName());
           fun(fi[i]);
       }
   }
   else{
       if(f.getName().equalsIgnoreCase(txtFile.getText()) || 
         (f.getName().toLowerCase().startsWith(txtFile.getText().toLowerCase())) ||     
         (f.getName().toLowerCase().endsWith(txtFile.getText().toLowerCase()))){    
           l.setText("file found " + f.getAbsolutePath()); // l is JLabel that indicated prints the info like file found and its path
           fileFound=true;
       }
   }
}
catch(Exception e){
}
}
  • 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-28T16:04:44+00:00Added an answer on May 28, 2026 at 4:04 pm

    The error you are observing may be due to nested symbolic links.

    The most effective approach to solve this problem would be to instead use FileUtils#iterateFiles from the excellent Apache Commons IO library.

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

Sidebar

Related Questions

I am currently developing a C# application to search a file in the computer.
I'm developing a back-end application for a search system. The search system copies files
I am developing a faceted search system. Below the search box, there's a radio
iam developing one application.In that i use the search bar for search the data.But
I'm developing a .NET WINDOWS FORM Application , I need to develop a search
I am thinking of developing a search engine, but have no idea about the
We're developing a Search Reporting feature for a client. One of the requirements is
I'm developing a search form. It has about 10 fields and a search button
I'm developing a Desktop Search Engine using VB9 (VS2008) and Lucene.NET. The Indexer in
I'm developing a Desktop Search Engine in Visual Basic 9 (VS2008) using Lucene.NET (v2.0).

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.