Phobos function to check if files are identical?

flamencofantasy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 14 11:26:52 PDT 2017


On Tuesday, 14 March 2017 at 08:31:20 UTC, XavierAP wrote:
> On Tuesday, 14 March 2017 at 08:12:16 UTC, Andrea Fontana wrote:
>>
>> First I would check if the files have different size or if 
>> they are the same file (same path, symlink, etc).
>
> Good idea. Good reason to have it in std.file. There might also 
> be platform dependent shortcuts?


   import std.mmfile;

   auto f1 = new MmFile("file1");
   auto f2 = new MmFile("file2");

   return f1[] == f2[];



More information about the Digitalmars-d-learn mailing list