Date: Fri, 26 Dec 2008 18:05:43 -0800 From: Gary Kline <kline@thought.org> To: Corey Chandler <lists@sequestered.net> Cc: FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG> Subject: Re: how can i be certain that a file has copied exactly? Message-ID: <20081227020543.GC29639@thought.org> In-Reply-To: <49558546.9050702@sequestered.net> References: <20081227011335.GA29354@thought.org> <49558546.9050702@sequestered.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 26, 2008 at 05:30:46PM -0800, Corey Chandler wrote: > 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 ugh, i just founf both gif's and jpeg's with that same suffix. have to use something like while (n = read...)>0 write(fd2, buf,n) if i want to copy these binary files. ... maybe not: who needs graphics? :-) -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 2.17a release of Jottings: http://jottings.thought.org/index.php
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081227020543.GC29639>