FileSyncProvider: DetectChanges not detecting certain files
I'm using the Microsoft Sync Framework to sync files using the FileSyncProvider
. One thing I noticed is that the method DetectChanges
of the FileSyncProvider
is ignoring or not detecting certain files.
Th开发者_如何转开发ese files are not locked by any process, the user has full rights to these files, and they are not password protected. The problematic files consist of two PDFs and one Word document. However, there are other PDFs and Word documents in the batch that are in fact being detected. I have copied the files over to another PC and had no luck.
I'm baffled as to why these files are not being detected. Thoughts?
The problem ended up being that the problematic files had the T
or Temporary
attribute. I was excluding files that had the T
attribute. To alleviate this, I added an exclude for files or folders that had the .tmp
extension.
FileSyncScopeFilter fileSyncScopeFilter = new FileSyncScopeFilter();
fileSyncScopeFilter.AttributeExcludeMask = FileAttributes.System | FileAttributes.Hidden;
fileSyncScopeFilter.FileNameExcludes.Add("*.tmp");
fileSyncScopeFilter.FileNameExcludes.Add("*.lnk");
fileSyncScopeFilter.FileNameExcludes.Add("*.pst");
精彩评论