[your code here]

bearophile bearophileHUGS at lycos.com
Thu Jan 31 02:30:01 PST 2013


Roumen Roupski:

> private bool equals(in string f1, in string f2)
> {
> 	if (getSize(f1) != getSize(f2))
> 		return false;	// different file sizes
>
> 	if (getSize(f1) == 0)
> 		return true;	// zero-length files are equal

Making equals() private is not useful, but maybe it's possible to 
make equals() nothrow.


> 	
> 	MmFile m1, m2;
> 	try
> 	{
> 		m1 = new MmFile(f1);
> 		m2 = new MmFile(f2);
> 		return m1[] == m2[];
> 	}

I have tried your little program on two files about 500 MBytes 
long, and the memory usage is strange. Is it doing the right 
thing?

Bye,
bearophile


More information about the Digitalmars-d mailing list