Backup & Restore Dbf Files
Moderator: Rathinagiri
Re: Backup & Restore Dbf Files
Hi Esgici,
I tested your Backup & Restore software.
Thank you very much.
I learned GetFolder(), PutFile(), GetCurrentFolder() functions from you.
I didn't know it
IMHO, this software has 2 problems.
1. When compressing it stores full path of files, which sometimes give problem, eg., restoring into another drive.
2. Progressbar for uncompress doesn't work properly.
UncompressFiles ( cZipFile, {|cFile,nPos| main.pbRestore.value := nPos ,;
main.StatusBar.Item(1) := cFile }, .T. )
In above function nPos doesn't return the percentage completed. (Please test with fewer number of large dbf files)
Regarding using low level C staff, I am fully agree with you. If I knew those functions, I didn't use C functions
With best regards.
Sudip
I tested your Backup & Restore software.
Thank you very much.
I learned GetFolder(), PutFile(), GetCurrentFolder() functions from you.
I didn't know it
IMHO, this software has 2 problems.
1. When compressing it stores full path of files, which sometimes give problem, eg., restoring into another drive.
2. Progressbar for uncompress doesn't work properly.
UncompressFiles ( cZipFile, {|cFile,nPos| main.pbRestore.value := nPos ,;
main.StatusBar.Item(1) := cFile }, .T. )
In above function nPos doesn't return the percentage completed. (Please test with fewer number of large dbf files)
Regarding using low level C staff, I am fully agree with you. If I knew those functions, I didn't use C functions
With best regards.
Sudip
With best regards,
Sudip
Sudip
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Backup & Restore Dbf Files
Hi all
Does anyone know a way to adding a second parameter for <Initial Folder> to GetFolder() function ?
Or a new function with this ability ?
Regards / saludos.
--
Esgici
Does anyone know a way to adding a second parameter for <Initial Folder> to GetFolder() function ?
Or a new function with this ability ?
Regards / saludos.
--
Esgici
Viva INTERNATIONAL HMG
Re: Backup & Restore Dbf Files
Hi Esgici,esgici wrote:Hi all
Does anyone know a way to adding a second parameter for <Initial Folder> to GetFolder() function ?
Or a new function with this ability ?
Please try the following simple sample:
Code: Select all
#include "minigui.ch"
Procedure Main()
DEFINE WINDOW Form_1 ;
AT 0,0 WIDTH 200 HEIGHT 150 ;
MAIN ;
TITLE "GetFolder Sample" ;
NOSIZE
DEFINE MAIN MENU
DEFINE POPUP 'Test'
MENUITEM 'BrowseForFolder()' ACTION MsgInfo(BrowseForFolder('Select Folder', GetCurrentFolder()),"Result")
MENUITEM 'Exit' ACTION Form_1.Release
END POPUP
END MENU
END WINDOW
Form_1.Center
Form_1.Activate
Return
*-----------------------------------------------------------------------------*
Static Function BrowseForFolder( cTitle, cInitPath )
*-----------------------------------------------------------------------------*
Return HMG_BrowseForFolder( NIL, cTitle, NIL, NIL, cInitPath )
*------------------------------------------------------------------------------*
* Low Level C Routines
*------------------------------------------------------------------------------*
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
#include <commdlg.h>
#include <shlobj.h>
#include <commctrl.h>
int CALLBACK BrowseCallbackProc ( HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData )
{
TCHAR szPath[ MAX_PATH ];
switch( uMsg )
{
case BFFM_INITIALIZED: if( lpData )
SendMessage( hWnd, BFFM_SETSELECTION, TRUE, lpData );
break;
case BFFM_SELCHANGED: SHGetPathFromIDList( ( LPITEMIDLIST ) lParam, szPath ); SendMessage( hWnd, BFFM_SETSTATUSTEXT, 0, ( LPARAM ) szPath );
}
return 0;
}
HB_FUNC( HMG_BROWSEFORFOLDER ) // Syntax: HMG_BROWSEFORFOLDER([<hWnd>],[<cTitle>],[<nFlags>],[<nFolderType>],[<cInitPath>])
{
HWND hWnd = HB_ISNIL( 1 ) ? GetActiveWindow() : ( HWND ) hb_parnl( 1 );
BROWSEINFO BrowseInfo;
char *lpBuffer = ( char * ) hb_xgrab( MAX_PATH + 1 );
LPITEMIDLIST pidlBrowse;
SHGetSpecialFolderLocation( hWnd, HB_ISNIL(4) ? CSIDL_DRIVES : hb_parni(4), &pidlBrowse );
BrowseInfo.hwndOwner = hWnd;
BrowseInfo.pidlRoot = pidlBrowse;
BrowseInfo.pszDisplayName = lpBuffer;
BrowseInfo.lpszTitle = HB_ISNIL( 2 ) ? "Select a Folder" : hb_parc( 2 );
BrowseInfo.ulFlags = HB_ISCHAR( 5 ) ? BIF_STATUSTEXT : hb_parni( 3 );
BrowseInfo.lpfn = HB_ISCHAR( 5 ) ? BrowseCallbackProc : NULL;
BrowseInfo.lParam = HB_ISCHAR( 5 ) ? ( LPARAM ) ( char * ) hb_parc( 5 ) : 0;
BrowseInfo.iImage = 0;
pidlBrowse = SHBrowseForFolder( &BrowseInfo );
if( pidlBrowse )
{
SHGetPathFromIDList( pidlBrowse, lpBuffer );
hb_retc( lpBuffer );
}
else
hb_retc( "" );
hb_xfree( lpBuffer );
}
#pragma ENDDUMP
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Backup & Restore Dbf Files
Wow. Thanks Grigory.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Backup & Restore Dbf Files
Thanks Grigorygfilatov wrote: Please try the following simple sample:
Itsn't so simple ( at least for me )
You are a real guru of our community;
Fortunately, you are here
Best regards
--
Esgici
Viva INTERNATIONAL HMG
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Backup & Restore Dbf Files
Hi
Our COMPRESS command doesn't include files smaller than (approximately 1 KB)
Any idea
Regards
--
Esgici
Our COMPRESS command doesn't include files smaller than (approximately 1 KB)
Any idea
Regards
--
Esgici
Viva INTERNATIONAL HMG
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Backup & Restore Dbf Files
Ohhh no ! Really ?Our COMPRESS command doesn't include files smaller than (approximately 1 KB)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Backup & Restore Dbf Files
Hola Pablo
Now, I'm not sure that problem is that "not including"
I'm compressing a folder with 55 files, and when open the .zip file by windows explorer, seen only 13 files. Seem missing files are small in size.
And with another folder, .zip file is empty ( including big files too)
I don't know may be any difference in implementation of .zip files, between our lib and Windows or other software.
Saludos
--
Esgici
Thanks to your interest amigoPablo César wrote:Ohhh no ! Really ?
Now, I'm not sure that problem is that "not including"
I'm compressing a folder with 55 files, and when open the .zip file by windows explorer, seen only 13 files. Seem missing files are small in size.
And with another folder, .zip file is empty ( including big files too)
I don't know may be any difference in implementation of .zip files, between our lib and Windows or other software.
Saludos
--
Esgici
Viva INTERNATIONAL HMG
Re: Backup & Restore Dbf Files
I was testing archive created in my program an it seems everything is OK with small files and compress...
Regards, Marek
Regards, Marek
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Backup & Restore Dbf Files
Hi Mol
Thanks to your interest
My problem isn't about file sizes, previous post about that is wrong, sorry
Now, problem is compressing files in other than current folder.
Could you test please attached sample ( sligthly modified your program ) by changing source folder ?
Moreover, our COMPRESS doesn't support :
Thanks to your interest
My problem isn't about file sizes, previous post about that is wrong, sorry
Now, problem is compressing files in other than current folder.
Could you test please attached sample ( sligthly modified your program ) by changing source folder ?
Moreover, our COMPRESS doesn't support :
- - Option for storing or omitting path info of compressed files
- Option for including or omitting sub-folders
- Compressing level
- Password protection
Viva INTERNATIONAL HMG