On Monday, 13 March 2017 at 17:47:09 UTC, H. S. Teoh wrote:
        bool isEqual(string filename1, string filename2) {
                import std.algorithm.comparison : equal;
                import std.range : zip;
                import std.stdio : File, chunks;

                auto f1 = File(filename1);
                auto f2 = File(filename2);

                size_t blockSize = 4096; // or something similar

                return f1.chunks(blockSize).equal(f2.chunks(blockSize));
        }

First I would check if the files have different size or if they are the same file (same path, symlink, etc).


Reply via email to