// fc.js - 中身が同じファイルを見つける
var CapicomUtil = new ActiveXObject("CAPICOM.Utilities");
// ↑
http://www.microsoft.com/downloads/details.aspx?FamilyID=860ee43a-a843-462f-abb5-ff88ea5896f6&DisplayLang=ja var Fso = new ActiveXObject("Scripting.FileSystemObject");
var Stream1 = new ActiveXObject("ADODB.Stream");
var Stream2 = new ActiveXObject("ADODB.Stream");
var StreamType = {Binary: 1, Text: 2};
var ReadSize = 64;
Stream1.Type = Stream2.Type = StreamType.Binary;
function CompareFiles(file1, file2) {
Stream1.Open();
Stream2.Open();
Stream1.LoadFromFile(file1);
Stream2.LoadFromFile(file2);
var rc = true;
while (! Stream1.EOS) {
if (CapicomUtil.BinaryToHex(Stream1.Read(ReadSize))
!= CapicomUtil.BinaryToHex(Stream2.Read(ReadSize))) {
rc = false;
break;
}
}
Stream1.Close();
Stream2.Close();
return rc;
}
/* つづく...