Dircompare

Author: c | 2025-04-24

★★★★☆ (4.8 / 1516 reviews)

excel cost analysis template

Introduction. In this tutorial we learn how to install libfile-dircompare-perl on Ubuntu 20.04. What is libfile-dircompare-perl. libfile-dircompare-perl is: File::DirCompare is a perl module to

programa para grabacion voz

DirCompare/DirCompare.csproj at master Mattiwatti/DirCompare

Detailed report --reason report - show reason when entries are distinct --csv report - print details as csv --nocolors don't use console colors --async Make use of multiple cores By default files are compared by size. --date-tolerance defaults to 1000 ms. Two files are considered to have the same date if the difference between their modification dates fits within date tolerance. Exit codes: 0 - entries are identical 1 - entries are different 2 - error occurred Examples: compare by content dircompare -c dir1 dir2 show only different files dircompare -d dir1 dir2 exclude filter dircompare -x ".git,node_modules" dir1 dir2 dircompare -x "/tests/expected" dir1 dir2 dircompare -x "**/expected" dir1 dir2 dircompare -x "**/tests/**/*.ts" dir1 dir2 include filter dircompare -f "*.js,*.yml" dir1 dir2 dircompare -f "/tests/**/*.js" dir1 dir2 dircompare -f "**/tests/**/*.ts" dir1 dir2Changelogv2.3.0 fixesv2.1.0 remove bluebird dependencyv2.0.0New option to compare symlinks.New field indicating reason for two entries being distinct.Improved command line output format.Tests are no longer part of published package.Generated Api documentation.Breaking changes:Broken links are no longer treated as errors. As a result there are new statistics (leftBrokenLinks, rightBrokenLinks, distinctBrokenLinks, totalBrokenLinks) and new entry type - broken-link.Details in Symbolic links.Typescript correction: new interface Result replaced Statistics.v1.8.0globstar patternstypescript correctionsremoved support for node 0.11, 0.12, iojsv1.7.0 performance improvementsv1.6.0 typescript supportv1.5.0 added option to ignore line endings and white space differencesv1.3.0 added date tolerance optionv1.2.0 added compare by date optionv1.1.0detect symlink loopsimproved color scheme for command line utilityv1.0.0asynchronous processingnew library options: noDiffSet, resultBuildernew statistics: distinctFiles, equalFiles, leftFiles, rightFiles, distinctDirs, equalDirs, leftDirs, rightDirsnew --async command line optionFix for Fix fille ordering issue for newer node versions Detailed report --reason report - show reason when entries are distinct --csv report - print details as csv --nocolors don't use console colors --async Make use of multiple cores By default files are compared by size. --date-tolerance defaults to 1000 ms. Two files are considered to have the same date if the difference between their modification dates fits within date tolerance. Exit codes: 0 - entries are identical 1 - entries are different 2 - error occurred Examples: compare by content dircompare -c dir1 dir2 show only different files dircompare -d dir1 dir2 exclude filter dircompare -x ".git,node_modules" dir1 dir2 dircompare -x "/tests/expected" dir1 dir2 dircompare -x "**/expected" dir1 dir2 dircompare -x "**/tests/**/*.ts" dir1 dir2 include filter dircompare -f "*.js,*.yml" dir1 dir2 dircompare -f "/tests/**/*.js" dir1 dir2 dircompare -f "**/tests/**/*.ts" dir1 dir2Changelogv2.1.0 remove bluebird dependencyv2.0.0New option to compare symlinks.New field indicating reason for two entries being distinct.Improved command line output format.Tests are no longer part of published package.Generated Api documentation.Breaking changes:Broken links are no longer treated as errors. As a result there are new statistics (leftBrokenLinks, rightBrokenLinks, distinctBrokenLinks, totalBrokenLinks) and new entry type - broken-link.Details in Symbolic links.Typescript correction: new interface Result replaced Statistics.v1.8.0globstar patternstypescript correctionsremoved support for node 0.11, 0.12, iojsv1.7.0 performance improvementsv1.6.0 typescript supportv1.5.0 added option to ignore line endings and white space differencesv1.3.0 added date tolerance optionv1.2.0 added compare by date optionv1.1.0detect symlink loopsimproved color scheme for command line utilityv1.0.0asynchronous processingnew library options: noDiffSet, resultBuildernew statistics: distinctFiles, equalFiles, leftFiles, rightFiles, distinctDirs, equalDirs, leftDirs, rightDirsnew --async command line optionFix for Fix fille ordering issue for newer node versions

DirCompare/README.md at main guochao2299/DirCompare

Regarding #126 (comment).If we consider this sample folder:test126.zip a*└── x [include] ├── a1.txt ├── a2.txt ├── a3.txt ├── a4.txt └── b2.txt [include]">├── a1.txt├── a2.txt├── b1.txt [include]├── .gitignore -> a*└── x [include] ├── a1.txt ├── a2.txt ├── a3.txt ├── a4.txt └── b2.txt [include]According to .gitignore, only the files marked with [include] above, should be shown.If I use vscode-compare-folders, and compare this folder against an empty folder, I get this result:It looks like it excludes all files except .gitignore. It should not exclude b1 and b2.I added some logs to investigate. And this is how dir-compare is called and its response.Options:{ ... "excludeFilter": ".git,a*", "includeFilter": "*", ...}And dircompare response:Directories are differentStatistics - equal entries: 0, distinct entries: 0, left only entries: 4, right only entries: 0, differences: 4b1.txt undefined leftx undefined leftb2.txt undefined left.gitignore undefined leftThe response from dircompare looks good. It correctly excludes a*, .git and includes everything else (b1, b2, .gitignore).I am unsure now where is the problem. Maybe it is related to the way dircompare result is handled by vscode-compare-folders.. Introduction. In this tutorial we learn how to install libfile-dircompare-perl on Ubuntu 20.04. What is libfile-dircompare-perl. libfile-dircompare-perl is: File::DirCompare is a perl module to libfile-dircompare-perl: No summary available for libfile-dircompare-perl in ubuntu kinetic. All versions of libfile-dircompare-perl source in Ubuntu; Versions published Release. The package

dirCompare/models.xmi at master erbth/dirCompare

Your own.Ignore line endings and white spacesLine based comparator can be used to ignore line ending and white space differences. This comparator is not available in CLI mode.var dircompare = require('dir-compare');var options = { compareContent: true, compareFileSync: dircompare.fileCompareHandlers.lineBasedFileCompare.compareSync, compareFileAsync: dircompare.fileCompareHandlers.lineBasedFileCompare.compareAsync, ignoreLineEnding: true, ignoreWhiteSpaces: true};var path1 = '...';var path2 = '...';var res = dircompare.compareSync(path1, path2, options);console.log(res)dircompare.compare(path1, path2, options).then(res => console.log(res))Custom result builderResult builder is called for each pair of entries encountered during comparison. Its purpose is to append entries in diffSet and eventually update statistics object with new stats.If needed it can be replaced with custom implementation.var dircompare = require("dircompare")var customResultBuilder = function (entry1, entry2, state, level, relativePath, options, statistics, diffSet, reason) { ...}var options = { compareSize: true, resultBuilder: customResultBuilder}var res = dircompare.compareSync('...', '...', options)The default builder can be used as an example.Symbolic linksUnless compareSymlink option is used, symbolic links are resolved and any comparison is applied to the file/directory they point to.Circular loops are handled by breaking the loop as soon as it is detected.Version 1.x treats broken links as ENOENT: no such file or directory.Since 2.0 they are treated as a special type of entry - broken-link - and are available as stats (totalBrokenLinks, distinctBrokenLinks, ...).Using compareSymlink option causes dircompare to check symlink values for equality.In this mode two entries with identical name are considered different ifone is symlink, the other is notboth are symlinks but point to different locationsThese rules are applied in addition to the other comparison modes; ie. by content, by size...If entries are different because of symlinks, reason will be different-symlink. Also statistics summarizes differences caused by symbolik links.Command line Usage: dircompare [options] leftdir rightdir Options: -h, --help output usage information -V, --version output the version number -c, --compare-content compare files by content -D, --compare-date compare files by date --date-tolerance [type] tolerance to be used in date comparison (milliseconds) --compare-symlink compare files and directories by symlink -f, --filter [type] file name filter -x, --exclude [type] file/directory name exclude filter -S, --skip-subdirs do not recurse into subdirectories -L, --skip-symlinks ignore symlinks -i, --ignore-case ignores case when comparing file names -l, --show-left report - show entries occurring in left dir -r, --show-right report - show entries occurring in right dir -e, --show-equal report - show identic entries occurring in both dirs -d, --show-distinct report - show distinct entries occurring in both dirs -a, --show-all report - show all entries -w, --whole-report report - include directories in -1))}const path1 = '/tmp/a';const path2 = '/tmp/b';const res = compare(path1, path2, options).then(res => { console.log(`Same: ${res.same}`) if (!res.diffSet) { return } res.diffSet.forEach(dif => console.log(`${dif.name1} ${dif.name2} ${dif.state}`))})// Outputs// icon.svg icon.png equal// logo.svg logo.jpg equalResult builderResult builder is called for each pair of entries encountered during comparison. Its purpose is to append entries in diffSet and eventually update statistics object with new stats.If needed it can be replaced with custom implementation.const dircompare = require("dircompare")const customResultBuilder = function (entry1, entry2, state, level, relativePath, options, statistics, diffSet, reason) { ...}const options = { compareSize: true, resultBuilder: customResultBuilder}const res = dircompare.compareSync('...', '...', options)The default builder can be used as an example.Glob filterThe current implementation of the glob filter uses minimatch and is based on includeFilter and excludeFilter options. While it is meant to fit most use cases, some scenarios are not addressed.Use filterHandler option to alter this behavior.The following example demonstrates how to include only files with a specific extension in our comparison.import { Options, compareSync, Result, FilterHandler, Entry, filterHandlers } from './'import { extname } from 'path'var d1 = '...';var d2 = '...';const filterByfileExtension: FilterHandler = (entry: Entry, relativePath: string, options: Options): boolean => { if (!options.fileExtension) { // Fallback on the default 'minimatch' implementation return filterHandlers.defaultFilterHandler(entry, relativePath, options) } return options.fileExtension === extname(entry.name)}const options: Options = { compareSize: true, fileExtension: '.txt', filterHandler: filterByfileExtension}const res: Result = compareSync(d1, d2, options)For reference, the default minimatch filter can be found in defaultFilterHandler which is exposed by filterHandlers property.Implement .gitignore filterGlobby library provides the functionality to parse

dirCompare/Commandline.cpp at master erbth/dirCompare

And compareFileAsync options which correspond to dircompare.compareSync() or dircompare.compare() methods.A couple of handlers are included in the library:binary sync compare - dircompare.fileCompareHandlers.defaultFileCompare.compareSyncbinary async compare - dircompare.fileCompareHandlers.defaultFileCompare.compareAsynctext sync compare - dircompare.fileCompareHandlers.lineBasedFileCompare.compareSynctext async compare - dircompare.fileCompareHandlers.lineBasedFileCompare.compareAsyncUse defaultFileCompare.js as an example to create your own.Ignore line endings and white spacesLine based comparator can be used to ignore line ending and white space differences.const dircompare = require('dir-compare');const options = { compareContent: true, compareFileSync: dircompare.fileCompareHandlers.lineBasedFileCompare.compareSync, compareFileAsync: dircompare.fileCompareHandlers.lineBasedFileCompare.compareAsync, ignoreLineEnding: true, // Ignore crlf/lf line ending differences ignoreWhiteSpaces: true, // Ignore white spaces at the beginning and end of a line (similar to 'diff -b') ignoreAllWhiteSpaces: true, // Ignore all white space differences (similar to 'diff -w') ignoreEmptyLines: true // Ignores differences caused by empty lines (similar to 'diff -B')};const path1 = '...';const path2 = '...';const res = dircompare.compareSync(path1, path2, options);console.log(res)dircompare.compare(path1, path2, options).then(res => console.log(res))Name comparatorsIf default name comparison is not enough, custom behavior can be specified with compareNameHandler option.Following example adds the possibility to ignore file extensions.import { Options, compare } from 'dir-compare'import path from 'path'const options: Options = { compareSize: false, // compare only name by disabling size and content criteria compareContent: false, compareNameHandler: customNameCompare, // new name comparator used to ignore extensions ignoreExtension: true, // supported by the custom name compare below};function customNameCompare(name1: string, name2: string, options: Options) { if (options.ignoreCase) { name1 = name1.toLowerCase() name2 = name2.toLowerCase() } if (options.ignoreExtension) { name1 = path.basename(name1, path.extname(name1)) name2 = path.basename(name2, path.extname(name2)) } return ((name1 === name2) ? 0 : ((name1 > name2) ? 1 :

dirCompare/win32_security_tools.cpp at master erbth/dirCompare

// exclude '/tests/expected' directory excludeFilter: "**/expected" , // exclude '/tests/expected' directory excludeFilter: "**/tests/**/*.js" , // exclude all js files in '/tests' directory and subdirectories includeFilter: "*.js,*.yml" , // include js and yaml files includeFilter: "/tests/**/*.js" , // include all js files in '/tests' directory and subdirectories includeFilter: "**/tests/**/*.ts" // include all js files in '/tests' directory and subdirectories }This behavior can be changed with Glob filter extensions.Symbolic linksUnless compareSymlink option is used, symbolic links are resolved and any comparison is applied to the file/directory they point to.Circular loops are handled by breaking the loop as soon as it is detected.Version 1.x treats broken links as ENOENT: no such file or directory.Since 2.0 they are treated as a special type of entry - broken-link - and are available as stats (totalBrokenLinks, distinctBrokenLinks, ...).Using compareSymlink option causes dircompare to check symlink values for equality.In this mode two entries with identical names are considered different ifone is symlink, the other is notboth are symlinks but point to different locationsThese rules are applied in addition to the other comparison modes; ie. by content, by size...If entries are different because of symlinks, reason will be different-symlink. Also statistics summarize differences caused by symbolic links.Handling permission denied errorsUnreadable files or directories are normally reported as errors. The comparison will be interrupted with an EACCES exception.This behavior can be altered with Options.handlePermissionDenied.Extension pointsFile content comparatorsBy default file content is binary compared. As of version 1.5.0 custom file comparison handlers may be specified.Custom handlers are specified by compareFileSync. Introduction. In this tutorial we learn how to install libfile-dircompare-perl on Ubuntu 20.04. What is libfile-dircompare-perl. libfile-dircompare-perl is: File::DirCompare is a perl module to libfile-dircompare-perl: No summary available for libfile-dircompare-perl in ubuntu kinetic. All versions of libfile-dircompare-perl source in Ubuntu; Versions published Release. The package

DirCompare/DirCompare.sln at master Mattiwatti/DirCompare

Dir-compareNode JS directory compareStarting with v3.0.0 the CLI utility moved to dir-compare-cli.InstallationLibraryUseApiGlob patternsSymbolic linksHandling permission denied errorsExtension pointsFile content comparatorsIgnore line endings and white spacesName comparatorsResult builderGlob filterImplement .gitignore filterUI toolsChangelogInstallationLibraryUseconst dircompare = require('dir-compare');const options = { compareSize: true };// Multiple compare strategy can be used simultaneously - compareSize, compareContent, compareDate, compareSymlink.// If one comparison fails for a pair of files, they are considered distinct.const path1 = '...';const path2 = '...';// Synchronousconst res = dircompare.compareSync(path1, path2, options)print(res)// Asynchronousdircompare.compare(path1, path2, options) .then(res => print(res)) .catch(error => console.error(error));function print(result) { console.log('Directories are %s', result.same ? 'identical' : 'different') console.log('Statistics - equal entries: %s, distinct entries: %s, left only entries: %s, right only entries: %s, differences: %s', result.equal, result.distinct, result.left, result.right, result.differences) result.diffSet.forEach(dif => console.log('Difference - path: %s, name1: %s, type1: %s, name2: %s, type2: %s, state: %s', dif.relativePath, dif.name1, dif.type1, dif.name2, dif.type2, dif.state))}Typescriptimport { compare, compareSync, Options, Result } from "dir-compare";const path1 = '...';const path2 = '...';const options: Options = { compareSize: true };const res: Result = compareSync(path1, path2, options);console.log(res)compare(path1, path2, options) .then(res => console.log(res)) .catch(error => console.error(error));Apicompare(path1: string, path2: string, options?: Options): PromiseResult>compareSync(path1: string, path2: string, options?: Options): ResultMore details can be found in the reference documentation:comparecompareSyncOptionsResultCommon options:compareSizecompareContentcompareDateexcludeFilterincludeFilterignoreCaseskipSubdirsskipEmptyDirsGlob patternsMinimatch patterns are used to include/exclude files to be compared.The pattern is matched against the relative path of the entry being compared.Following examples assume we are comparing two dir-compare code bases.const options = { excludeFilter: ".git,node_modules", // exclude git and node modules directories excludeFilter: "expected" , // exclude '/tests/expected' directory excludeFilter: "/tests/expected" ,

Comments

User2777

Detailed report --reason report - show reason when entries are distinct --csv report - print details as csv --nocolors don't use console colors --async Make use of multiple cores By default files are compared by size. --date-tolerance defaults to 1000 ms. Two files are considered to have the same date if the difference between their modification dates fits within date tolerance. Exit codes: 0 - entries are identical 1 - entries are different 2 - error occurred Examples: compare by content dircompare -c dir1 dir2 show only different files dircompare -d dir1 dir2 exclude filter dircompare -x ".git,node_modules" dir1 dir2 dircompare -x "/tests/expected" dir1 dir2 dircompare -x "**/expected" dir1 dir2 dircompare -x "**/tests/**/*.ts" dir1 dir2 include filter dircompare -f "*.js,*.yml" dir1 dir2 dircompare -f "/tests/**/*.js" dir1 dir2 dircompare -f "**/tests/**/*.ts" dir1 dir2Changelogv2.3.0 fixesv2.1.0 remove bluebird dependencyv2.0.0New option to compare symlinks.New field indicating reason for two entries being distinct.Improved command line output format.Tests are no longer part of published package.Generated Api documentation.Breaking changes:Broken links are no longer treated as errors. As a result there are new statistics (leftBrokenLinks, rightBrokenLinks, distinctBrokenLinks, totalBrokenLinks) and new entry type - broken-link.Details in Symbolic links.Typescript correction: new interface Result replaced Statistics.v1.8.0globstar patternstypescript correctionsremoved support for node 0.11, 0.12, iojsv1.7.0 performance improvementsv1.6.0 typescript supportv1.5.0 added option to ignore line endings and white space differencesv1.3.0 added date tolerance optionv1.2.0 added compare by date optionv1.1.0detect symlink loopsimproved color scheme for command line utilityv1.0.0asynchronous processingnew library options: noDiffSet, resultBuildernew statistics: distinctFiles, equalFiles, leftFiles, rightFiles, distinctDirs, equalDirs, leftDirs, rightDirsnew --async command line optionFix for Fix fille ordering issue for newer node versions

2025-04-24
User3709

Detailed report --reason report - show reason when entries are distinct --csv report - print details as csv --nocolors don't use console colors --async Make use of multiple cores By default files are compared by size. --date-tolerance defaults to 1000 ms. Two files are considered to have the same date if the difference between their modification dates fits within date tolerance. Exit codes: 0 - entries are identical 1 - entries are different 2 - error occurred Examples: compare by content dircompare -c dir1 dir2 show only different files dircompare -d dir1 dir2 exclude filter dircompare -x ".git,node_modules" dir1 dir2 dircompare -x "/tests/expected" dir1 dir2 dircompare -x "**/expected" dir1 dir2 dircompare -x "**/tests/**/*.ts" dir1 dir2 include filter dircompare -f "*.js,*.yml" dir1 dir2 dircompare -f "/tests/**/*.js" dir1 dir2 dircompare -f "**/tests/**/*.ts" dir1 dir2Changelogv2.1.0 remove bluebird dependencyv2.0.0New option to compare symlinks.New field indicating reason for two entries being distinct.Improved command line output format.Tests are no longer part of published package.Generated Api documentation.Breaking changes:Broken links are no longer treated as errors. As a result there are new statistics (leftBrokenLinks, rightBrokenLinks, distinctBrokenLinks, totalBrokenLinks) and new entry type - broken-link.Details in Symbolic links.Typescript correction: new interface Result replaced Statistics.v1.8.0globstar patternstypescript correctionsremoved support for node 0.11, 0.12, iojsv1.7.0 performance improvementsv1.6.0 typescript supportv1.5.0 added option to ignore line endings and white space differencesv1.3.0 added date tolerance optionv1.2.0 added compare by date optionv1.1.0detect symlink loopsimproved color scheme for command line utilityv1.0.0asynchronous processingnew library options: noDiffSet, resultBuildernew statistics: distinctFiles, equalFiles, leftFiles, rightFiles, distinctDirs, equalDirs, leftDirs, rightDirsnew --async command line optionFix for Fix fille ordering issue for newer node versions

2025-04-05
User3202

Regarding #126 (comment).If we consider this sample folder:test126.zip a*└── x [include] ├── a1.txt ├── a2.txt ├── a3.txt ├── a4.txt └── b2.txt [include]">├── a1.txt├── a2.txt├── b1.txt [include]├── .gitignore -> a*└── x [include] ├── a1.txt ├── a2.txt ├── a3.txt ├── a4.txt └── b2.txt [include]According to .gitignore, only the files marked with [include] above, should be shown.If I use vscode-compare-folders, and compare this folder against an empty folder, I get this result:It looks like it excludes all files except .gitignore. It should not exclude b1 and b2.I added some logs to investigate. And this is how dir-compare is called and its response.Options:{ ... "excludeFilter": ".git,a*", "includeFilter": "*", ...}And dircompare response:Directories are differentStatistics - equal entries: 0, distinct entries: 0, left only entries: 4, right only entries: 0, differences: 4b1.txt undefined leftx undefined leftb2.txt undefined left.gitignore undefined leftThe response from dircompare looks good. It correctly excludes a*, .git and includes everything else (b1, b2, .gitignore).I am unsure now where is the problem. Maybe it is related to the way dircompare result is handled by vscode-compare-folders.

2025-04-15
User9536

Your own.Ignore line endings and white spacesLine based comparator can be used to ignore line ending and white space differences. This comparator is not available in CLI mode.var dircompare = require('dir-compare');var options = { compareContent: true, compareFileSync: dircompare.fileCompareHandlers.lineBasedFileCompare.compareSync, compareFileAsync: dircompare.fileCompareHandlers.lineBasedFileCompare.compareAsync, ignoreLineEnding: true, ignoreWhiteSpaces: true};var path1 = '...';var path2 = '...';var res = dircompare.compareSync(path1, path2, options);console.log(res)dircompare.compare(path1, path2, options).then(res => console.log(res))Custom result builderResult builder is called for each pair of entries encountered during comparison. Its purpose is to append entries in diffSet and eventually update statistics object with new stats.If needed it can be replaced with custom implementation.var dircompare = require("dircompare")var customResultBuilder = function (entry1, entry2, state, level, relativePath, options, statistics, diffSet, reason) { ...}var options = { compareSize: true, resultBuilder: customResultBuilder}var res = dircompare.compareSync('...', '...', options)The default builder can be used as an example.Symbolic linksUnless compareSymlink option is used, symbolic links are resolved and any comparison is applied to the file/directory they point to.Circular loops are handled by breaking the loop as soon as it is detected.Version 1.x treats broken links as ENOENT: no such file or directory.Since 2.0 they are treated as a special type of entry - broken-link - and are available as stats (totalBrokenLinks, distinctBrokenLinks, ...).Using compareSymlink option causes dircompare to check symlink values for equality.In this mode two entries with identical name are considered different ifone is symlink, the other is notboth are symlinks but point to different locationsThese rules are applied in addition to the other comparison modes; ie. by content, by size...If entries are different because of symlinks, reason will be different-symlink. Also statistics summarizes differences caused by symbolik links.Command line Usage: dircompare [options] leftdir rightdir Options: -h, --help output usage information -V, --version output the version number -c, --compare-content compare files by content -D, --compare-date compare files by date --date-tolerance [type] tolerance to be used in date comparison (milliseconds) --compare-symlink compare files and directories by symlink -f, --filter [type] file name filter -x, --exclude [type] file/directory name exclude filter -S, --skip-subdirs do not recurse into subdirectories -L, --skip-symlinks ignore symlinks -i, --ignore-case ignores case when comparing file names -l, --show-left report - show entries occurring in left dir -r, --show-right report - show entries occurring in right dir -e, --show-equal report - show identic entries occurring in both dirs -d, --show-distinct report - show distinct entries occurring in both dirs -a, --show-all report - show all entries -w, --whole-report report - include directories in

2025-04-23

Add Comment