Page 1 of 1

Updating a shared file

Posted: Thu Jan 19, 2012 9:13 am
by dConlin
I have code that looks something like:

Code: Select all


private void UpgradeFile(string localPath, VaultClientFolder root){

   string remotePath = m_Client.TreeCache.GetCorrespondingRepositoryPath(localPath);
           
   VaultClientFile file = root.FindFileRecursive(remotePath);           

   m_Client.Get(file, false, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.Unspecified, null);                

}

Which works just dandy most of the time. However, when the file in question is a shared file, the call to FindFileRecursive returns null, presumably because the thing that is there is a "soft link" rather than a "real" file. Is there a nice way to fix this?

Re: Updating a shared file

Posted: Thu Jan 19, 2012 11:15 am
by Beth
Which version of Vault are you using?

Re: Updating a shared file

Posted: Thu Jan 19, 2012 1:32 pm
by dConlin
Fixed! The problem was thus:

When you share a folder, it doesn't count as a change to the sharing location. So if A is a shared copy of B, when you ask A the time it was last changed, it replies with the time B was last changed.

This works fine unless you shared B as A after the last change to B. When this happens, when you ask A when it was last changed, it replies with the last time B was changed, which is actually *before* A was even created. This is pretty confusing, and led to me trying to update to a copy of the parent folder at a version when A didn't exist.

Re: Updating a shared file

Posted: Thu Jan 19, 2012 2:13 pm
by Beth
Thanks for the update. This may help others as well.