FVSDK_ERROR_CODE FVSDK_SyncFolders(FVSDK_Session* pSession, LPCTSTR pszRemotePath, LPCTSTR pszLocalPath, DWORD dwSyncOptions, LPCTSTR pszIgnoreStartingWith, long nMaxThreads);
Perform the Synchronize Folders operation or bring up the Synchronize Folders dialog, providing options to the end user. The Synchronize Folders operation mirrors either remote or local directories depending on the dwSyncOptions value or what the user selects.
pSession
A pointer to the FVSDK_Session that is to perform the operation.
pszRemotePath
A NULL terminated string containing the remote directory's full path.
pszLocalPath
NULL terminated string containing the local directory's full path.
dwSyncOptions
The options to apply to the operation or dialog. Each bit of this parameter is defined in FVSDK_Funcs.h.
FVSDK_SYNCOPT_SYNCREMOTE applicable only when FVSDK_SYNCOPT_USEDIALOG is not set FVSDK_SYNCOPT_SYNCLOCAL applicable only when FVSDK_SYNCOPT_USEDIALOG is not set FVSDK_SYNCOPT_IGNORECASE ignore file and directory letter case when comparing the local and remote files and directories FVSDK_SYNCOPT_COMPARESIZE compare file size when determining the required synchronize folders action FVSDK_SYNCOPT_COMPARETIME compare the file time when determining the required synchronize folders action FVSDK_SYNCOPT_INCLUDEDIRS search subdirectories in addition to the specified directories FVSDK_SYNCOPT_DONTDELETE don't delete any files when synchronizing (i.e., when the file doesn't also exist in the other directory) FVSDK_SYNCOPT_OVERWRITECONFIRMATIONS prompt the user prior to overwriting files, asking the user's permission FVSDK_SYNCOPT_DELETECONFIRMATIONS prompt the user prior to deleting files, (FVSDK_SYNCOPT_DONTDELETE must not be set) FVSDK_SYNCOPT_REMOTEIGNORENEWER do not perform the date / time comparison on files that are newer on the server (important for systems where the file date and time cannot be maintained after uploads) FVSDK_SYNCOPT_REMOTEIGNOREOLDER do not perform the date / time comparison on files that are older on the server FVSDK_SYNCOPT_LOCALIGNORENEWER do not perform the date / time comparison on files that are newer on the local machine FVSDK_SYNCOPT_LOCALIGNOREOLDER do not perform the date / time comparison on files that are older on the local machine (important for systems where the file date and time cannot be maintained after uploads) FVSDK_SYNCOPT_MINIMIZESTATUSDIALOGS pop-up transfer dialogs may be used, but minimize them FVSDK_SYNCOPT_QUEUEERRORMESSAGES put all errors into a queue for display when complete FVSDK_SYNCOPT_IGNORESYMBOLICLINKS when UNIX symbolic links are encountered, do not attempt to synchronize these files or directories FVSDK_SYNCOPT_USEDIALOG present the FTP Voyager Synchronize Folders dialog to the user; when not set, the synchronize folders operations are carried out with no user intervention
pszIgnoreStartingWith
A NULL terminated string containing characters to use for ignoring files. Each character in this string is checked against the first character of a file or directory ONLY; this is not a wild card mask. For example if '_' appears in this string, all files and directories starting with the '_' character are ignored.
nMaxThreads
1 to 10, the maximum number of concurrent transfers to use for the synchronization operation.
FVSDK_YES if the operation was successfully started.
DWORD dwSyncOptions = 0;
// set the synchronize folders options
dwSyncOptions |= FVSDK_SYNCOPT_IGNORECASE;
dwSyncOptions |= FVSDK_SYNCOPT_COMPARESIZE;
dwSyncOptions |= FVSDK_SYNCOPT_COMPARETIME;
dwSyncOptions |= FVSDK_SYNCOPT_INCLUDEDIRS;
dwSyncOptions |= FVSDK_SYNCOPT_DONTDELETE;
dwSyncOptions |= FVSDK_SYNCOPT_OVERWRITECONFIRMATIONS;
dwSyncOptions |= FVSDK_SYNCOPT_DELETECONFIRMATIONS;
dwSyncOptions |= FVSDK_SYNCOPT_REMOTEIGNOREOLDER;
dwSyncOptions |= FVSDK_SYNCOPT_LOCALIGNORENEWER;
dwSyncOptions |= FVSDK_SYNCOPT_QUEUEERRORMESSAGES;
dwSyncOptions |= FVSDK_SYNCOPT_USEDIALOG;
// do the sync folders
FVSDK_SyncFolders(pSession, "/", "C:\\My Web Page\\", dwSyncOptions, "", 1);