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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:26:21+00:00 2026-06-03T03:26:21+00:00

What is the order in which Files.walkFileTree visits files/directories at the same level? It

  • 0

What is the order in which Files.walkFileTree visits files/directories at the same level?

It doesn’t appear to visit them in order of size, last modified time or name. I couldn’t find anything in the API documentation either.

Perhaps the preVisitDirectory method can be used to specify the order of visit but what is default behaviour ?

  • 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-03T03:26:23+00:00Added an answer on June 3, 2026 at 3:26 am

    The order in which the subdirectories are read is not defined as per this comment in the Java Tutorial:

    A file tree is walked depth first, but you cannot make any assumptions about the iteration order that subdirectories are visited.

    As for the order in which the files are read, it depends (in the current implementation) on the supplied DirectoryStream, which is sun.nio.fs.WindowsDirectoryStream on my computer. Reading the javadoc of DirectoryStream, you will see that:

    The elements returned by the iterator are in no specific order.

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

Sidebar

Related Questions

How to sort a file which is very huge in size in order of
How do you specify, in Visual Studio 2010, the order in which library files
Could anyone explain the order in which jar files are loaded from the lib
I have two files which the order of lines is irrelevant, and I want
I have a rather large SQL file which starts with the byte order marker
I have two entities say Customer and Order which exist on their own and
I have a table called order which contains columns id , user_id , price
I'm executing an external application using the CreateProcess function, in order which such application
Does the order in which parameters are passed to a stored procedure affect the
XmlElement has an Order attribute which you can use to specify the precise order

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.