Page 2 of 5

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 2:50 pm
by sudip
Hi Friend Vanguarda,

Thank you very much. I am a very anxious person. Thank God! Now, I am little relaxed. :)
Vanguarda wrote:Hi friend Sudip,

It working fine.

Very good you code.
you learn very good, the low level. Good luck with your tests

i know that this is only a example of low level. but for compress and make a backup, i agree with Esgici:

"BTW, why you don't use CompressFiles(), UncompressFiles() functions or COMPRESS, UNCOMPRESS commands of HMG?"

When you get a another code post for us, guy. Please go ahead with their functions and codes on the low level.
This was very good. Congratulations.

PS: Sorry my bad english
Regarding UncompressFiles() function, please read the documentation in my last mail. I am sure, you may find "some" reasons behind my "R & D" :)

With best regards.

Sudip

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 2:51 pm
by esgici
Hi Sudip
sudip wrote: If there is an EASIER way to do it with UNCOMPRESS command, ...
I guess yes.

I'll try.

Regarding "low level" concept, my teacher always told me : "If you have an higher way, choose always it !"

Regards

--

Esgici

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 2:55 pm
by Vanguarda
Hi friend Sudip,

i read you last mail.

Now i understand because you make use of low level.

Anyway you code was very good and very useful.

Thanks for sharing wiht us. i will use this im my softwares. if you agree!


regards,

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 3:08 pm
by sudip
Hi Rathi,

Thank you for your codes. Previously I used

Code: Select all

    aeval(aDirectory, {|x| aadd(aFiles, cFolder+"\"+x[1])})
    
    main.pbBackup.value := 0
    main.pbBackup.visible := .t.
		
    COMPRESS FILES afiles ;
            TO cZipFile ;
            BLOCK {|cFile,nPos| main.pbBackup.value := nPos/len(aFiles)*100 } ;
            OVERWRITE  				
    main.pbBackup.value := 0
    main.pbBackup.visible := .f.
But, it has a problem. It stores full path of the .dbf files (including drive letters) into the zip file. Moreover, using HB_ functions you can display the progress of each file also (which is very useful in case of large file).

And for UNCOMPRESS command. Don't know how can I find number and file names within a zip file before uncomressing. But, those (specially number) is essential for using progress bar for generic use.

As a very advanced user, you must have faced above problems. So, please help me regarding this problem.

With best regards.

Sudip

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 3:11 pm
by sudip
Vanguarda wrote: Thanks for sharing wiht us. i will use this im my softwares. if you agree!
Yes, ofcourse! With pleasure! I am honored :)

Regards.

Sudip

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 3:13 pm
by sudip
esgici wrote:Hi Sudip
sudip wrote: If there is an EASIER way to do it with UNCOMPRESS command, ...
I guess yes.

I'll try.

Regarding "low level" concept, my teacher always told me : "If you have an higher way, choose always it !"
I am agree with my "teacher's" teacher :D

With best regards.

Sudip

Re: Backup & Restore Dbf Files

Posted: Fri May 15, 2009 3:21 pm
by Rathinagiri
As I am using MySQL a lot in my projects, I had not used zip components recently to backup/restore.

I will check your code in a deeper way.

Re: Backup & Restore Dbf Files

Posted: Sat May 16, 2009 2:39 am
by fchirico
sudip wrote:Hi All,

I was experimenting how to zip and unzip files with HMG.


Please downlowd
BackRest.zip
. Compile and run.

And please tell me how to upgrade this project.

Sudip
It's very silly ... but who wants to make backup of everything ...


if MsgYesNo ( 'Backup only DBF extension ?','What files ?', .f. )
aDirectory := directory(cFolder+"\*.dbf")
else
aDirectory := directory(cFolder+"\*.*")
endif


Saludos, Fernando Chirico.

Re: Backup & Restore Dbf Files

Posted: Sat May 16, 2009 3:41 am
by sudip
Hi Fernando Chirico,

Excellent idea! I like it :)

With best regards.

Sudip

Re: Backup & Restore Dbf Files

Posted: Sat May 16, 2009 6:39 pm
by esgici
Hi !
esgici wrote:I'll try.
Tried.

Succeed with one exception : without target folder selecting option while restoring.

Regarding "low level" concept, HMG is higher level tool than Harbour. But direct using Harbour modules can't assuming low level approach.

My intention with "low level" was that #pragma BEGIN / END DUMP sections !

Whenever seen, I'm saying : "Alas ! somethings will goes wrong and I will can't make anything !"

Regards

--

Esgici