compareWith method

Future<bool> compareWith(
  1. File file
)

Comparing two files for content equality.

Implementation

Future<bool> compareWith(
  File file,
) async {
  // TODO relativePath -> uri
  final rPath1 = stat().relativePath;
  final rPath2 = file.stat().relativePath;
  if (rPath1 is String && rPath2 is String && equals(rPath1, rPath2)) {
    return true;
  }
  return (await file.generateHash()) == (await generateHash());
}