Beispiel #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);
                //}
            },
Beispiel #2
0
        private static void WriteModifyLine(TextWriter writer, ref Win32.FIND_DATA src, ref Win32.FIND_DATA trg, string FullFilename)
        {
            writer.WriteLine(
                "{0:X}|{1:X}"
                + "\t{2}|{3}"
                + "\t{4}|{5}"
                + "\t{6}"

                , src.dwFileAttributes
                , (trg.dwFileAttributes == src.dwFileAttributes ? "-" : trg.dwFileAttributes.ToString("X"))

                , ConvertFiletimeToString(src.ftLastWriteTime, FullFilename, "lastWriteTime")
                , CmpDirs.CmpFileTimes(src.ftLastWriteTime, trg.ftLastWriteTime) == 0 ? "-" : ConvertFiletimeToString(trg.ftLastWriteTime, FullFilename, "lastWriteTime")

                , src.FileSize
                , src.FileSize == trg.FileSize ? "-" : trg.FileSize.ToString()

                , FullFilename
                );
        }