Getting Started Synchronizing Files

https://msdn.microsoft.com/en-US/library/bb902813(v=sql.110).aspx

Sync Framework includes a file synchronization provider that extends the UnmanagedSyncProviderWrapper object (for managed code) orIKnowledgeSyncProvider interface (for unmanaged code)

to simplify creation of an application that synchronizes files and folders among file systems.

Creating and Initializing the Provider

Managed code An application creates a FileSyncProvider object. Paths and configuration options are specified in the constructor.

托管代码,创建FileSyncProvider对象,在构造函数中指定路径和配置选项

Unmanaged code An application creates an IFileSyncProvider object by passing CLSID_FileSyncProvider and IID_IFileSyncProvider toCoCreateInstance.

Paths and configuration options are specified by calling the Initialize method.

The paths that are specified when the provider is constructed or initialized define the root folder to synchronize, and the folder and file name in which the synchronization metadata is stored.

Optionally, the application can also specify a folder to store temporary files and a folder to store files that are updated because of a conflict.

These must be valid paths and must exist before the provider is initialized.

 Note

For all methods in the file synchronization provider, paths cannot exceed MAX_PATH.

A set of configuration flags can be specified when the provider is constructed or initialized.

These flags modify the behavior of the provider in various ways, such as to improve change detection by calculating a hash value for each file, or to move deleted files to the recycle bin instead of permanently deleting them.

These flags are represented by FileSyncOptions (for managed code) or FILESYNC_INIT_FLAGS (for unmanaged code).

After source and destination providers have been created and initialized, they can be passed to a synchronization session and synchronization can be started.

File Attributes

Sync Framework recognizes only the following file and folder attributes:

  • FILE_ATTRIBUTE_DIRECTORY
  • FILE_ATTRIBUTE_READONLY
  • FILE_ATTRIBUTE_HIDDEN
  • FILE_ATTRIBUTE_SYSTEM
  • FILE_ATTRIBUTE_TEMPORARY

Other file attributes are ignored and are not propagated传送.

Security and Encryption

The provider does not perform any authentication on the folders that are involved in synchronization.

The application must authenticate the folders that are used before it passes them to the provider.

Security information, such as the Discretionary Access Control List (DACL), is not propagated.

It is up to the application or user to correctly secure the destination folders to help prevent unauthorized access.

Files in an encrypted folder are decrypted before they are sent and will not be encrypted in the destination folder.

Be aware that this means that even if the source folder is encrypted, the files will still not be encrypted when they are sent.

To help prevent unauthorized access or tampering篡改, the communication channel between the provider and the folder must be trusted.

Synchronization metadata and temporary files are stored in folders specified when the provider is initialized.

These folders must be appropriately secured and the temporary folder cleaned up to avoid unwanted information disclosure, because these files might contain user data.

Consistency Guarantee

Sync Framework guarantees that, when the file synchronization provider applies a change, if all contents of a file stream cannot be applied then no content will be.

This is done in part by opening the files in exclusive share mode.

This means that the file cannot be opened or deleted by any other application until its handle is closed.

For more information, see the CreateFile function in the Microsoft Win32 documentation.

If the file cannot be opened in exclusive share mode it will be skipped.

The skip will be recorded in the metadata so that it can be processed appropriately in future sessions.

Metadata Storage 

The file synchronization provider uses the metadata storage service to store all synchronization metadata in a custom data store.

The metadata store is one file.

This file can be stored with the files and folders that are to be synchronized or in another location that is specified when the provider is initialized.

For more information about metadata storage service components, see Sync Framework Metadata Storage Service.

时间: 2024-08-28 04:47:04

Getting Started Synchronizing Files的相关文章

Introducing Microsoft Sync Framework: Sync Services for File Systems

https://msdn.microsoft.com/en-us/sync/bb887623 Introduction to Microsoft Sync Framework File Synchronization Provider Introduction Microsoft Sync Framework is a comprehensive综合 synchronization同步 platform that enables collaboration合作 and offline scena

A replacement solution to using Google Drive in Ubuntu

Grive2 Get dependencies You need to get the dependency libraries along with their development (-dev or -devel) packages: yajl 2.x libcurl STL (libstdc++) libgcrypt Boost (filesystem, program_options, regex, unit_test_framework and system) expat There

Total Commander 8.52 Beta 1

Total Commander 8.52 Beta 1http://www.ghisler.com/852_b1.php 10.08.15 Release Total Commander 8.52 beta 1 (32/64) 05.08.15 Fixed: Windows 10: Loading drive buttonbar hanging on some devices (e.g. Surface Pro 3) when SD-Card was in internal card reade

Linux系统实时数据同步inotify+rsync

一.inotify简介 inotify是Linux内核的一个功能,它能监控文件系统的变化,比如删除.读.写和卸载等操作.它监控到这些事件的发生后会默认往标准输出打印事件信息.要使用inotify,Linux内核版本必须是大于2.6.13,在这之前的内核都没有这个功能.我们可以利用inotify去监控我们要监控的资源,当资源发生变化时,我们扑捉它的事件,从而触发同步数据等操作. 二.inotify软件介绍 inotify是内核的一个功能,众所周知内核的功能我们必须要配合工具才能使用,通常情况下用户

出现unmapped spring configuration files found

intell idea启动出现unmapped spring configuration files found提示. 把spring里面的内容都打勾.

My first makefile to compile multiple C files

I have three files to compile: main.c, func.c,  func.h The steps: 1   main.c   to   main.o 2   func.c    to   func.o 3    link main.o func.o to main(file that can execute) So, u need to run at least three commands without a Makefile.Then if u have 10

没有躲过的坑--你开发的软件安装在C盘Program Files (x86)下产生的异常

今天偶然发现的问题,就是自己写的win32程序安装在C盘Program Files (x86)文件夹下就会产生异常,而安装在其他文件夹,即使是D盘的Program Files (x86)下,程序也可以完美运行. 引起这个,肯定是权限的问题.这个软件运行时,需要读写数据库,以及各种缓存数据. 这就是我给自己挖的一个坑儿,相信很多人也会遇到这个问题. 就是在开发程序.VS调试的时候,总喜欢使用当前路径,或者是相对路径.即把一些数据与.exe文件放在一起. 但是安装的时候,选择的是C盘Program

【Android-tips】 Unable to execute dex: Multiple dex files define 解决方法

唔,之前已经想过今后不动android,没想到还是因为比赛的原因重操旧业.android有很多问题是由于eclipse的不完善造成的,比如今天遇到的这个问题 Unable to execute dex: Multiple dex files define [2011-10-23 16:23:29 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/myapp/R$array; [2011-10-23 16:23:

【分享】利用Apache的Htaccess Files命令限制访问文件类型,Files正则

如果你在你的模板文件夹中有很多PSD HTML模板,那么用接下来这个htaccess文件可以保护限制访问: 文件D:\WebSite\ZBPHP.COM\www\Tpl\.htaccess 全部源码如下: <Files ~ "\.(html?|tpl|psd|zip|rar)$"> Order Allow,Deny Deny from all </Files> [分享]利用Apache的Htaccess Files命令限制访问文件类型,Files正则,布布扣,b