From: Gorka guardiola <paurea@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Q: checking CD vs. iso image
Date: Mon, 22 Aug 2005 10:16:31 -0500 [thread overview]
Message-ID: <599f06db05082208167b392080@mail.gmail.com> (raw)
In-Reply-To: <1124730719.3070.34.camel@localhost.localdomain>
Congratulations, you just reinvented cmp(1). You should now go for ps(1).
On 8/22/05, alexandr babic <alexandr@babi.cz> wrote:
> hi.
>
> 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 :-)
>
> alexandr.
>
>
> check.c
> ------------------------------
> #include <u.h>
> #include <libc.h>
>
> void main()
> {
> int cdfd,isofd,i,r;
> unsigned char C,I;
>
> cdfd=open("/dev/sdD0/data",OREAD);
> isofd=open("obraz.iso",OREAD);
>
> i=0;
>
> while(1)
> {
> r=read(cdfd,(void*)&C,1);
> if(r==0) break;
> r=read(isofd,(void*)&I,1);
> if(r==0) break;
> i++;
>
> if(C==I) print("byte position=%d, bytes are same!\n",i);
> else print("byte position=%d, bytes differ! cd is %d, iso is %d
> \n",i,C,I);
> }
>
> close(cdfd);
> close(isofd);
> exits(0);
> }
>
>
--
- curiosity sKilled the cat
next prev parent reply other threads:[~2005-08-22 15:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-22 17:11 alexandr babic
2005-08-22 15:16 ` Gorka guardiola [this message]
2005-08-22 15:20 ` Anselm R. Garbe
-- strict thread matches above, loose matches on Subject: below --
2005-08-22 12:08 pac7
2005-08-22 12:38 ` Russ Cox
2005-08-22 12:46 ` Uriel
2005-08-22 12:55 ` Russ Cox
2005-08-22 15:05 ` Gorka guardiola
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=599f06db05082208167b392080@mail.gmail.com \
--to=paurea@gmail.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).