Skip to content

CompareDirectories Method ​

Definition ​

  • Namespace: JASE.IO
  • Assembly: JASE.dll

bool CompareDirectories(string dir1, string dir2, string fileMask = null, SearchOption searchOption = null) ​

csharp
bool CompareDirectories(string dir1, string dir2, string fileMask = null, SearchOption searchOption = null)

Compares two directories for equality based on a file mask and search option.

Parameters ​

NameDescription
dir1The path to the first directory.
dir2The path to the second directory.
fileMaskThe search pattern to match against files in each directory (for example, "*.txt"). If , all files are included.
searchOptionSpecifies whether to search only the top directory or all subdirectories.

Returns ​

if both directories contain the same set of files (by name and content) according to the mask and search option; otherwise .