Ignore:
Timestamp:
2/3/2010 3:37:13 AM (2 years ago)
Author:
lowjoel
Message:

Forward ported changes from trunk to r1743

Location:
branches/eraser6/CodeReview
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview

  • branches/eraser6/CodeReview/Eraser.Manager/Task.cs

    r1709 r1745  
    456456                    string adsPath = file + ':' + adsName; 
    457457                    list.Add(adsPath); 
    458                     Util.StreamInfo info = new Util.StreamInfo(adsPath); 
     458                    StreamInfo info = new StreamInfo(adsPath); 
    459459                    totalSize += info.Length; 
    460460                } 
     
    693693                Regex excludePattern = new Regex(regex, RegexOptions.IgnoreCase); 
    694694                foreach (FileInfo file in files) 
    695                     if ((file.Attributes & FileAttributes.ReparsePoint) == 0 && 
     695                    if (file.Exists && 
     696                        (file.Attributes & FileAttributes.ReparsePoint) == 0 && 
    696697                        excludePattern.Matches(file.FullName).Count == 0) 
    697698                    { 
     
    704705                foreach (FileInfo file in files) 
    705706                { 
    706                     if ((file.Attributes & FileAttributes.ReparsePoint) != 0) 
     707                    if (!file.Exists || (file.Attributes & FileAttributes.ReparsePoint) != 0) 
    707708                        continue; 
    708709 
     
    807808                        continue; 
    808809 
    809                     GetRecyclerFiles(dir, ref result, ref totalSize); 
     810                    GetRecyclerFiles(dir, result, ref totalSize); 
    810811                } 
    811812            } 
     
    820821        /// <param name="paths">The list of files to store path information in.</param> 
    821822        /// <param name="totalSize">Receives the total size of the files.</param> 
    822         private void GetRecyclerFiles(DirectoryInfo info, ref List<string> paths, 
     823        private void GetRecyclerFiles(DirectoryInfo info, List<string> paths, 
    823824            ref long totalSize) 
    824825        { 
    825826            try 
    826827            { 
    827                 foreach (FileSystemInfo fsInfo in info.GetFileSystemInfos()) 
     828                foreach (FileInfo fileInfo in info.GetFiles()) 
    828829                { 
    829                     FileInfo fileInfo = fsInfo as FileInfo; 
    830                     if (fileInfo != null) 
    831                     { 
    832                         totalSize += fileInfo.Length; 
    833                         GetPathADSes(paths, out totalSize, fileInfo.FullName); 
    834                         paths.Add(fileInfo.FullName); 
    835                     } 
    836                     else 
    837                         GetRecyclerFiles((DirectoryInfo)fsInfo, ref paths, ref totalSize); 
     830                    if (!fileInfo.Exists || (fileInfo.Attributes & FileAttributes.ReparsePoint) != 0) 
     831                        continue; 
     832 
     833                    totalSize += fileInfo.Length; 
     834                    GetPathADSes(paths, out totalSize, fileInfo.FullName); 
     835                    paths.Add(fileInfo.FullName); 
    838836                } 
     837 
     838                foreach (DirectoryInfo directoryInfo in info.GetDirectories()) 
     839                    if ((directoryInfo.Attributes & FileAttributes.ReparsePoint) == 0) 
     840                        GetRecyclerFiles(directoryInfo, paths, ref totalSize); 
    839841            } 
    840842            catch (UnauthorizedAccessException e) 
Note: See TracChangeset for help on using the changeset viewer.