473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to compare two directories?

I want to compare 2 directories,
and find If all of theire sub-folders and files and sub-files are identical..
If not the same, I want know which files or folders are not the same.
I know filecmp moudle has cmpfiles function and a class named dircmp,
they may help, but I wonder if there is a ready-to-use function in python libs?
If not, would somebody like to give me some propositions?

Thank you.
Jul 19 '05 #1
4 3628
could ildg wrote:
I want to compare 2 directories,
and find If all of theire sub-folders and files and sub-files are identical.
If not the same, I want know which files or folders are not the same.
I know filecmp moudle has cmpfiles function and a class named dircmp,
they may help, but I wonder if there is a ready-to-use function in python libs?


That's a good start. Why doesn't dircmp work for you?
--
Michael Hoffman
Jul 19 '05 #2
I found dircmp compare only the direct dirs and files,
and it will not do anything to the sub-directories.

On 6/29/05, Michael Hoffman <ca*******@mh391.invalid> wrote:
could ildg wrote:
I want to compare 2 directories,
and find If all of theire sub-folders and files and sub-files are identical.
If not the same, I want know which files or folders are not the same.
I know filecmp moudle has cmpfiles function and a class named dircmp,
they may help, but I wonder if there is a ready-to-use function in python libs?


That's a good start. Why doesn't dircmp work for you?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list

Jul 19 '05 #3
could ildg wrote:
I found dircmp compare only the direct dirs and files,
and it will not do anything to the sub-directories.


The documentation for dircmp.report_full_closure() disagrees with you.
--
Michael Hoffman
Jul 19 '05 #4
Thank you~
I get it.

On 6/30/05, Michael Hoffman <ca*******@mh391.invalid> wrote:
could ildg wrote:
I found dircmp compare only the direct dirs and files,
and it will not do anything to the sub-directories.


The documentation for dircmp.report_full_closure() disagrees with you.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Robin Siebler | last post by:
I have two directory trees that I want to compare and I'm trying to figure out what the best way of doing this would be. I am using walk to get a list of all of the files in each directory. I...
0
by: Jeff Higgins | last post by:
Hi all Newbie to XPath. Can someone help with an XPath expression(s) that will accomplish the following using JAXP in J2SE-1.5. Thanks Jeff Higgins In a class I have two private org.w3c.dom...
1
by: Heath | last post by:
I'm dealing with a C# application that monitors changes to the file system, and need to exclude irrelevent directories, temp directories for example. Is there any way to identify such...
8
by: Peter Larsen [] | last post by:
Hi, If i have a mapped drive and an UNC path - both pointing to the same directory on the server, how do i determine if they match (point to the same directory on the server) ?? Thank you....
3
by: could.net | last post by:
I want to compare 2 directories: dir1 and dir2. What I want to do is to get these informations: 1. does they have the same number of files and sub-directories? 2. does each file with the same name...
4
by: rn5a | last post by:
I have a ListBox which should list all the files & directories that exist in a particular directory. The problem is I can get the ListBox to list either all the files or all the directories but not...
5
by: stamatis32 | last post by:
Hello everybody, i want to make a prog to compare the contents of 2 dirs. You can compare easily 2 files, but how this happend with dirs. I am very confused, i dont know where to start from, can...
1
by: Richard | last post by:
I'm writing code to compare two directories side-by-side, like FolderMatch or FolderSync. I've used ListBoxes in VB6, so have the idea about concatenating strings for list items, but have no...
6
by: =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post by:
Hello, I am using Visual Studio-2003. I created a project to build my library. Since I am using third party libraries as well, I have specified those additional library dependencies in project...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.