- // Check for zero length files because some systems croak when you try to
- // mmap an empty file.
- uint64_t A_size;
- if (sys::fs::file_size(NameA, A_size))
- return false;
-
- uint64_t B_size;
- if (sys::fs::file_size(NameB, B_size))
- return false;
-
- // If they are both zero sized then they're the same
- if (A_size == 0 && B_size == 0)
- return 0;
-
- // If only one of them is zero sized then they can't be the same
- if ((A_size == 0 || B_size == 0)) {
- if (Error)
- *Error = "Files differ: one is zero-sized, the other isn't";
- return 1;
- }
-