Backup & Restore Dbf Files

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 1 time

Re: Backup & Restore Dbf Files

Post by sudip » Fri May 15, 2009 2:50 pm

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
With best regards,
Sudip

User avatar
esgici
Posts: 4514
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Post by esgici » Fri May 15, 2009 2:51 pm

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
Viva INTERNATIONAL HMG :D

User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Been thanked: 1 time
Contact:

Post by Vanguarda » Fri May 15, 2009 2:55 pm

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,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 1 time

Post by sudip » Fri May 15, 2009 3:08 pm

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
With best regards,
Sudip

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 1 time

Post by sudip » Fri May 15, 2009 3:11 pm

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
With best regards,
Sudip

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 1 time

Post by sudip » Fri May 15, 2009 3:13 pm

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
With best regards,
Sudip

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Fri May 15, 2009 3:21 pm

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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
fchirico
Posts: 324
Joined: Sat Aug 23, 2008 11:27 pm
Location: Argentina

Post by fchirico » Sat May 16, 2009 2:39 am

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.
Saludos, Fernando Chirico.

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 1 time

Post by sudip » Sat May 16, 2009 3:41 am

Hi Fernando Chirico,

Excellent idea! I like it :)

With best regards.

Sudip
With best regards,
Sudip

User avatar
esgici
Posts: 4514
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Post by esgici » Sat May 16, 2009 6:39 pm

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
Attachments
BackRest(BE).zip
High level backup - Restore
(2.01 KiB) Downloaded 313 times
Viva INTERNATIONAL HMG :D

Post Reply