Page 1 of 3
Utility compare directory
Posted: Wed Dec 14, 2016 9:44 am
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
Re: Utility compare directory
Posted: Fri Dec 16, 2016 9:05 pm
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 (169.1 KiB) Viewed 48072 times
Re: Utility compare directory
Posted: Mon Dec 19, 2016 4:28 am
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
Re: Utility compare directory
Posted: Mon Dec 19, 2016 8:37 am
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
Re: Utility compare directory
Posted: Tue Dec 20, 2016 7:10 am
by Wolfgang Ciriack
I see no chance to choose an other drive than C: ?!?!
Re: Utility compare directory
Posted: Tue Dec 20, 2016 7:51 am
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
Re: Utility compare directory
Posted: Tue Dec 20, 2016 10:03 am
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 (167.45 KiB) Viewed 47996 times
Re: Utility compare directory
Posted: Fri Dec 23, 2016 11:14 am
by sdenjupol148
Dieter,
Nice job!
Bobby
Re: Utility compare directory
Posted: Mon Dec 26, 2016 8:27 pm
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.
Re: Utility compare directory
Posted: Tue Dec 27, 2016 9:31 am
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)}}