Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching for compare directories utility
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00582535
Message ID:
00582563
Views:
42
Actually, I know how I can approach it. Just create two cursors with files and their modification dates (using recursive Ed Rauh - or Dave Frankenbach approach), then compare these cursors, that's all. I can print a report based on this comparision. I guess, I was just playing lazy and don't want to do the minimal required coding...



>He-he, looks odd in VFP and English world... I like "Parameters - nema" :)
>Anyway, thanks :)
>
>>>Hi everybody,
>>>
>>>I need to compare bunch of directories on drive O with same directories name on drive G. I need to find files, which are newer or don't exist and make a list of all discrepencies. I can write this program, but may be somebody has this kind of utility written, so I don't need to re-invent the wheel.
>>>
>>>Thanks a lot in advance.
>>
>>Just a little paste from my archives...
>>
>>
*+ uporeðuje direktorije
>>* Program èita fajl Pack_it.cmd (pravi ga pack.prg) i tra?i da se;
>>	izabere drugi direktorij. Zatim èita tekuæi i taj drugi direktorij;
>>	i to samo fajlove èija su imena (sa eventualnim d?okerima) zapisana;
>>	u pack_it.cmd, ispisuje imena, du?ine i vremena za obe verzije,;
>>	i oznaku koja je verzija novija (tekuæa ili druga)
>>* Parametri: nema
>>* istorija: 17.01.95 v1.0
>>*-
>>close all
>>dd=getdir("drugi direktorij")
>>x=fopen("pack_it.cmd")
>>r=fgets(x)
>>* do pron with "newer.txt"
>>SET ALTERNATE TO "newer.txt"
>>SET ALTERNATE on
>>? "File", sys(5)+curd() at 14, dd at 46
>>set cons on
>>do while !feof(x)
>>	n1= adir(w,r)
>>	n2= adir(z,dd+r)
>>	if n1>0
>>		=asort(w)
>>	else
>>		dime w(1,5)
>>		w=""
>>	endif
>>	if n2>0
>>		=asort(z)
>>	else
>>		dime z(1,5)
>>		z=""
>>	endif
>>	store 1 to i1, i2
>>	store .f. to g1, g2
>>	do while i1<n1 and i2<n2
>>		if !g1 and !g2
>>			do cmp
>>		endif
>>		if g1
>>			i1=i1+iif(i1<n1,1,0)
>>			g1=.f.
>>		endif
>>		if g2
>>			i2=i2+iif(i2<n2,1,0)
>>			g2=.f.
>>		endif
>>	endd
>>	r=fgets(x)
>>endd
>>SET ALTERNATE TO
>>SET ALTERNATE off
>>MODIFY COMMAND newer.txt
>>
>>proc cmp
>>do case
>>	case w(i1,1)<z(i2,1)
>>		_prg=w(i1,1)
>>		g1=.t.
>>	case w(i1,1)>z(i2,1)
>>		_prg=z(i2,1)
>>		g2=.t.
>>	other
>>		_prg=w(i1,1)
>>		g1=.t.
>>		g2=.t.
>>endc
>>
>>? _prg
>>if g1
>>	?? w(i1,2) at 14, w(i1,3), w(i1,4)
>>endif
>>do case
>>	case g1 and not g2
>>		?? "< " at 43
>>	case g2 and not g1
>>		?? " >" at 43
>>	case w(i1,3)= z(i2,3)
>>		do case
>>			case w(i1,4) == z(i2,4)
>>				?? "==" at 43
>>			case w(i1,4) > z(i2,4)
>>				?? "< " at 43
>>			other
>>				?? " >" at 43
>>		endc
>>	case w(i1,3)> z(i2,3)
>>		?? "< " at 43
>>	other
>>		?? " >" at 43
>>endc
>>
>>if g2
>>	?? z(i2,2) at 46, z(i2,3), z(i2,4)
>>ENDIF
>>
>>
>>Contents of pack_it.cmd could be like this:
>>
*.pr?
>>*.?pr
>>*.fr?
>>*.sc?
>>*.lb?
>>*.sc?
>>opis*.*
>>config.*
>>*.vc?
>>*.pjx
>>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform