From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <599f06db05082208167b392080@mail.gmail.com> Date: Mon, 22 Aug 2005 10:16:31 -0500 From: Gorka guardiola To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Q: checking CD vs. iso image In-Reply-To: <1124730719.3070.34.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1124730719.3070.34.camel@localhost.localdomain> Topicbox-Message-UUID: 7af8ef0a-ead0-11e9-9d60-3106f5b1d025 Congratulations, you just reinvented cmp(1). You should now go for ps(1). On 8/22/05, alexandr babic wrote: > hi. >=20 > and what about to compare one byte from cd with one byte from iso > by following short program, but i haven't plan9 here so you have > to try by yourself :-) >=20 > alexandr. >=20 >=20 > check.c > ------------------------------ > #include > #include >=20 > void main() > { > int cdfd,isofd,i,r; > unsigned char C,I; >=20 > cdfd=3Dopen("/dev/sdD0/data",OREAD); > isofd=3Dopen("obraz.iso",OREAD); >=20 > i=3D0; >=20 > while(1) > { > r=3Dread(cdfd,(void*)&C,1); > if(r=3D=3D0) break; > r=3Dread(isofd,(void*)&I,1); > if(r=3D=3D0) break; > i++; >=20 > if(C=3D=3DI) print("byte position=3D%d, bytes are same!\n",i); > else print("byte position=3D%d, bytes differ! cd is %d, iso is %d > \n",i,C,I); > } >=20 > close(cdfd); > close(isofd); > exits(0); > } >=20 >=20 --=20 - curiosity sKilled the cat