Пример #1
0
        private void CompareTwoDirectories(ParallelCtx relativeDir, Spi.ParallelExecutor <ParallelCtx, object, RootDirs> executor, object ctx, ref RootDirs rootDir)
        {
            AppendDir(ref rootDir.source, relativeDir.dirToSearchSinceRootDir);
            AppendDir(ref rootDir.target, relativeDir.dirToSearchSinceRootDir);

            CmpDirs.Run(rootDir.source, rootDir.target,
                        (DIFF_STATE diffstate, Win32.FIND_DATA find_data_src, Win32.FIND_DATA find_data_trg) =>
            {
                GetDirToEnum(diffstate, ref find_data_src, ref find_data_trg, out string newDirToEnum, out uint attrs);

                if (newDirToEnum != null && WalkIntoDir(attrs, _opts.followJunctions, relativeDir.depth, _opts.maxDepth))
                {
                    executor.Enqueue(new ParallelCtx(Path.Combine(relativeDir.dirToSearchSinceRootDir, newDirToEnum), relativeDir.depth + 1));
                }

                //if (diffstate != DIFF_STATE.SAMESAME)
                //{
                _diffHandler(diffstate, relativeDir.dirToSearchSinceRootDir, ref find_data_src, ref find_data_trg);
                //}
            },
Пример #2
0
 public void Start()
 {
     _executor.Enqueue(new ParallelCtx(String.Empty, 0));
 }