Compares two files byte by byte. Returns -1 if they are identical, otherwise the 0-based byte position of the first difference.
fileMismatch(filepath1, filepath2)
→ returns numeric
The files match up to line, so the first difference is at byte 10.
a = getTempFile(getTempDirectory(), "a");
b = getTempFile(getTempDirectory(), "b");
fileWrite(a, "line1#chr(10)#line2");
fileWrite(b, "line1#chr(10)#lineX");
writeOutput(fileMismatch(a, b));
Expected Result: 10
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.