Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!mhuxr!ulysses!allegra!bellcore!decvax!wanginst!ucadmus!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.unix-wizards Subject: fread, yet again Message-ID: <6785@brl-tgr.ARPA> Date: Wed, 26-Dec-84 10:38:51 EST Article-I.D.: brl-tgr.6785 Posted: Wed Dec 26 10:38:51 1984 Date-Received: Fri, 28-Dec-84 05:07:48 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 21 /* i wish our 4.2bsd vax was connected to arpa instead of vms... here is the output of a program i ran vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv n = 180 buf = ----- /* z.c */ #includemain() { char buf[999]; int n; FILE *f; f = fopen("z.c","r"); n = fread(buf,1,998,f); printf("n = %d\nbuf = -----\n%s\n-----\n",n,buf); } /* z.c */ ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i could have formatted it a bit better, but it shows that fread works the way it claims to. it is useful too. */