This project is read-only.

SynchronizeFolder - Is it working?

Feb 8, 2013 at 4:45 AM

I am trying to use SynchronizeFolder to sync to the latest version of a file, but it does not seem to be working. The SynchronizeFolder call is executed but doesn't seem to do anything.
There is an existing file (file.txt) in the appData directory that I wish to update with the latest file in cloudDirectoryExe. I don't want to download the file every time. I just wish to synchronise it. What is this method actually checking?

var appData = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)) + @"\download"

var cloudDirectoryExe = dropBoxStorage.GetFolder("/exe");

dropBoxStorage.SynchronizeFolder(appData, cloudDirectoryExe, AppLimit.CloudComputing.SharpBox.CloudStorage.SyncFolderFlags.DownloadItems);

//I was also considering this, but it feels like reinventing the wheel....

var fileName="file.txt";
var fiText= new FileInfo(Path.Combine(appData .FullName, fileName));
var file = dropBoxStorage.GetFile(fileName, cloudDirectoryExe);

if (fiText.Length != file.Length && fiText.LastWriteTimeUtc < file.Modified)
//download the file? Or does SynchronizeFolder doing some some of delta download?