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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:16:33+00:00 2026-06-01T22:16:33+00:00

I want to compare 2 directory stuctures (only files), so first I’ll get some

  • 0

I want to compare 2 directory stuctures (only files), so first I’ll get some list of files, with this structure: Filename|size
For ilustration:
(1):

C:\Downloads\100 Java Tips.pdf|1025kB
C:\Downloads\1590599799.rar|1000kB
C:\Downloads\573440.flv|50000kb
C:\Downloads\575492.flv|40000kb
C:\Downloads\avira_antivir_personal_en.exe|15000kB
C:\Downloads\backup-mkyong.com-12-24-2009.tar.gz|2000kB

Then I want to compare 2 directory sturctres = I will have two files with list directory structure (see (1)). One file will be reference the second file will be compared.
I have only tree outcomes:
1)ok – file in first structure exist in second structure with same size
2)fail1 – file in first sturcture doesn´t exist in second
3)fail2 – file in first structure exist in second structure but have diffrent size

My question is, what is best for storing the data what i´ll be comparing?
For example I put the data from file1 to “shelf1” and from file2 to “shelf2”.
Question is what the shelf should be? Array, …
Thanks

  • 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-01T22:16:35+00:00Added an answer on June 1, 2026 at 10:16 pm

    If you have the same paths (absolute or relative) you could use a hashmap and use the path as the key and the size (or the corresponding File object) as the value.

    Then loop over the entries of map 1 and check if they exist in map 2 and have the same value (i.e. size).

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

Sidebar

Related Questions

I want to get a list of files in a directory, but I want
What I want to do is create a list of files to compare in
i have two integer array, each size 95700.i want compare to two integer arrays,i
I want to compare two ms-access .mdb files to check that the data they
I want to compare the first few bytes in byte[] with a string. How
I want to compare two CSV files to see if they are different. I
I want to compare two (or more) XMLs files by tags names and attributes
Possible Duplicate: How can I compare (directory) paths in C#? I have a filename
I want to compare C++ class/structure objects. In C, most of the time, one
I want to compare 2 files with the same name in different directories. $1

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.