From owner-freebsd-questions Sat Jan 15 10:58:42 2000 Delivered-To: freebsd-questions@freebsd.org Received: from web113.yahoomail.com (web113.yahoomail.com [205.180.60.84]) by hub.freebsd.org (Postfix) with SMTP id 17C9014E7E for ; Sat, 15 Jan 2000 10:58:40 -0800 (PST) (envelope-from caradusa@yahoo.com) Received: (qmail 4741 invoked by uid 60001); 15 Jan 2000 18:58:39 -0000 Message-ID: <20000115185839.4740.qmail@web113.yahoomail.com> Received: from [12.128.181.113] by web113.yahoomail.com; Sat, 15 Jan 2000 10:58:39 PST Date: Sat, 15 Jan 2000 10:58:39 -0800 (PST) From: Carlos Maracabay Subject: Language C on Freebsd Release 3.3 Question. To: freebsd-questions@FreeBSD.ORG MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi! I have problems making a simple program that opens a file, to view it contents on the monitor scream... what's the problem in this source file, to do this, in Freebsd?? Any help will be apreciated. Thanks for your time! Regards, Dimetriov. #include #include #include #include main(int argc, char *argv[]) { int f1,n; char buf[BUFSIZ]; if(argc != 2) printf("Argument meesing\n"); if(f1 = open(argv[1], O_RDONLY,0) == -1) printf("cp cant open \n"); while((n = read(f1,buf,BUFSIZ)) > 0) if(write(1,buf,n) != n) #I think here is my problem printf("cp error while openinf file\n"); return 0; } __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message