From owner-freebsd-questions@FreeBSD.ORG Sat Dec 27 01:31:05 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD391065676 for ; Sat, 27 Dec 2008 01:31:05 +0000 (UTC) (envelope-from lists@sequestered.net) Received: from alcatraz.sequestered.net (alcatraz.sequestered.net [24.199.11.2]) by mx1.freebsd.org (Postfix) with ESMTP id EFD788FC22 for ; Sat, 27 Dec 2008 01:31:04 +0000 (UTC) (envelope-from lists@sequestered.net) Received: from singularity.sequestered.net (unknown [192.168.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jay@sequestered.net) by alcatraz.sequestered.net (Postfix) with ESMTPSA id 22F416817F; Fri, 26 Dec 2008 17:30:47 -0800 (PST) Message-ID: <49558546.9050702@sequestered.net> Date: Fri, 26 Dec 2008 17:30:46 -0800 From: Corey Chandler User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Gary Kline References: <20081227011335.GA29354@thought.org> In-Reply-To: <20081227011335.GA29354@thought.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SEQUESTERED-NET-MailScanner-Watermark: 1230946248.04714@YtSPvQW4qvwrL16xz0BM2g X-SEQUESTERED-NET-MailScanner-Information: Please contact Sequestered.net support for more information X-MailScanner-ID: 22F416817F.813C6 X-SEQUESTERED-NET-MailScanner: Found to be clean X-SEQUESTERED-NET-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.6, required 6, J_CHICKENPOX_37 0.60) X-SEQUESTERED-NET-MailScanner-From: lists@sequestered.net X-Spam-Status: No Cc: FreeBSD Mailing List Subject: Re: how can i be certain that a file has copied exactly? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2008 01:31:05 -0000 Gary Kline wrote: > folks, > > is there a way i can be sure that my little C program has copied a > dos/win file named, say, foo.htm\;7 to simply foo.htm? > > my program uses fopen/fgets/fputs to copy the markup files. of > the several i have copied, no problem. unless i hack cmp or diff, > i have to avoid the shell. > > any ideas? in other words, does anybody have a prefab cmp(oldfile, newfile) > fn? > > gary > > > http://www.daemonology.net/bsdiff/ seems to maybe do what you want-- essentially diff should solve your problem, although I'm not too clear on how that works on differently compiled binaries. I also seem to recall there was a test function that returned different results based on if the two files mentioned as arguments were identical, but I can't recall offhand quite what it was. -- CJC