Date: Sat, 15 Jan 2000 10:58:39 -0800 (PST) From: Carlos Maracabay <caradusa@yahoo.com> To: freebsd-questions@FreeBSD.ORG Subject: Language C on Freebsd Release 3.3 Question. Message-ID: <20000115185839.4740.qmail@web113.yahoomail.com>
next in thread | raw e-mail | index | archive | help
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 <stdio.h> #include <fcntl.h> #include <sys/types.h> #include <unistd.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000115185839.4740.qmail>