Revision 97f51ab0 trunk/Pithos.Core/Agents/NetworkAgent.cs

b/trunk/Pithos.Core/Agents/NetworkAgent.cs
630 630
            if (_firstPoll) return;
631 631

  
632 632
            var deleteCandidates = from state in FileState.Queryable
633
                                   let stateUrl = FileInfoExtensions.FromPath(state.FilePath)
634
                                       .AsRelativeUrlTo(accountInfo.AccountPath)
635
                                   where state.Modified <= pollTime &&
636
                                         !cloudFiles.Any(r => r.Name == stateUrl)
633
                                   where state.Modified <= pollTime && state.FilePath.StartsWith(accountInfo.AccountPath)
637 634
                                   select state;
638 635

  
639 636
            foreach (var deleteCandidate in deleteCandidates)
640 637
            {
641
                File.Delete(deleteCandidate.FilePath);
642
                StatusKeeper.ClearFileStatus(deleteCandidate.FilePath);
638
                var localFile = FileInfoExtensions.FromPath(deleteCandidate.FilePath);
639
                var relativeFilePath=localFile.AsRelativeTo(accountInfo.AccountPath);
640
                if (!cloudFiles.Any(r => Path.Combine(r.Container, r.Name) == relativeFilePath))
641
                {
642
                    localFile.Delete();
643
                    StatusKeeper.ClearFileStatus(deleteCandidate.FilePath);
644
                }
643 645
            }
644 646
        }
645 647

  

Also available in: Unified diff