Utility compare directory

This forum is for ideas and or code to be contributed for general use.
Message
Author
D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

Utility compare directory

#1 Post by D. Schuster »

Hi,
here is a small utility program to make it easier to compare two directories.
The directories to be compared can be selected as well as a filter for type of
files. the 2 directories are displayed green marked are newer files, yellow
marked files are not present in the other directory. File can be copied and deleted.
Dieter
Compare.zip
(382.63 KiB) Downloaded 506 times
Attachments
Compare.JPG
Compare.JPG (153.63 KiB) Viewed 24018 times

User avatar
rdonnay
Site Admin
Posts: 4158
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Utility compare directory

#2 Post by rdonnay »

I like your utility and I took the liberty to make a few improvements.

I eliminated the first screen and made it a little bit more robust and dynamic.

Now, the user can change directories and file type on the fly with an instant refresh.

I attached the updated source code.

Here is the utility in a self-extracting .zip. It uses Xbase++ 2.0 and eXpress++ build 264.

http://bb.donnay-software.com/util/dcsynchro.exe
snychro.jpg
snychro.jpg (169.1 KiB) Viewed 23966 times
Attachments
synchro.zip
(3.86 KiB) Downloaded 528 times
The eXpress train is coming - and it has more cars.

D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

Re: Utility compare directory

#3 Post by D. Schuster »

Thank's Roger,
the program looks now much better. The disadvantage is
that the browse arrays are not refreshed after calling their function.

Dieter

---------------------------------------
@ 21.5,82 DCPUSHBUTTONXP ;
CAPTION 'Copy files from ; Dir B to Dir A' ;
SIZE 25, 3 ;
ACTION {||Kopiere("BtoA",@aDir1,@aDir2,cDir1,cDir2),;
DC_GetRefresh(GetList)} ;
COLOR COLOR_DARKGREEN, COLOR_LTBLUE ;
MOUSECOLOR nil, COLOR_CYAN ;
CLICKCOLOR nil, COLOR_PINK ;
BITMAP BITMAP_PREVIOUS_M OFFSET 15 ;
FONT '12.Arial Bold' ;
RADIUS 20 ;
OBJECT oButton2 ;
SHADOW 6

User avatar
rdonnay
Site Admin
Posts: 4158
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Utility compare directory

#4 Post by rdonnay »

I didn't finish my testing. My bad.

Here is an update.
I tested it this time.

Also, here is self-extracting version:

http://bb.donnay-software.com/util/dcsynchro.exe
Attachments
dcsynchro.zip
(3.92 KiB) Downloaded 512 times
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 354
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Utility compare directory

#5 Post by Wolfgang Ciriack »

I see no chance to choose an other drive than C: ?!?!
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4158
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Utility compare directory

#6 Post by rdonnay »

I added the below code to the source. This will replace the DC_PopDir() function in DCLIPX.DLL.
New source is attached.

Here is updated self-extracting version. http://bb.donnay-software.com/util/dcsynchro.exe

Code: Select all

FUNCTION DC_PopDir()

LOCAL GetList[0], oDirs, oFiles, cDirectory, lStatus, cFileName2, cDir

cDirectory := ''

 @ 0,0 DCDIRTREE ;
       DIRS oDirs VAR cDirectory DATALINK {|c|cDir := c} ;
       FILES oFiles VAR cFileName2 ;
       SIZE 60,20 ;
       EXT '*.*' ;
       FONT '10.Lucida Console'

DCREAD GUI FIT MODAL ADDBUTTONS TO lStatus TITLE 'Choose Directory'

RETURN cDir

Attachments
dcsynchro.zip
(4.09 KiB) Downloaded 496 times
The eXpress train is coming - and it has more cars.

D. Schuster
Posts: 38
Joined: Mon Feb 15, 2010 4:01 am

Re: Utility compare directory

#7 Post by D. Schuster »

Hello,
this is the newest version of 'compare directories' (incl. DC_Popdir)
Functions:
-compare any directories
-set a filter on type of file (via DCCombobox)
-newer files are marked
-files not present in other directory are marked, just as number of files
-sort of directories on name or date
-copy or delete files

That's it (for the moment)
Dieter
Compare.JPG
Compare.JPG (167.45 KiB) Viewed 23890 times
Attachments
COMPARE.zip
(383.84 KiB) Downloaded 538 times

User avatar
SbDrakos
Posts: 131
Joined: Thu Jan 28, 2010 10:27 am
Location: NYC

Re: Utility compare directory

#8 Post by SbDrakos »

Dieter,

Nice job!


Bobby

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: Utility compare directory

#9 Post by GeneB »

Excellent utility.
What about adding the ability for the user to enter any filename extension filter so that it can be used to clean up other file types
such as mp3, mp4, jpg, etc.
This has great potential for cleaning up music, photo, video, etc. folders, not just for programmers.

Good work.

User avatar
rdonnay
Site Admin
Posts: 4158
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Utility compare directory

#10 Post by rdonnay »

What about adding the ability for the user to enter any filename extension filter so that it can be used to clean up other file types such as mp3, mp4, jpg, etc.
These code changes will give you that capability. Just type in the file spec.

Code: Select all

#include "Appevent.Ch"
....

LOCAL bLoad := {|| LoadDirArrays(cDir1,aDir1,cDir2,aDir2,cType),DC_GetRefresh(GetList)}

....

 @ 0.0, 64 DCCOMBOBOX cType LIST aTypeF SIZE 12,15 FONT '12.Lucida Console' ;
           ITEMSELECTED bLoad ;
           EVAL {|o|o:keyboard := {|n,b,o|IIF(n==xbeK_ENTER,(o:getData(),Eval(bLoad)),nil)}}
The eXpress train is coming - and it has more cars.

Post Reply