From mboxrd@z Thu Jan 1 00:00:00 1970 From: joy Subject: problem in open sys call Date: Wed, 21 Apr 2004 00:01:40 +0530 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <40856C8C.9090003@sancharnet.in> Reply-To: gracecott@sancharnet.in Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary_(ID_MUzZrV0aja/CE1sPUNOqxQ)" Return-path: List-Id: To: linux-c-programming@vger.kernel.org This is a multi-part message in MIME format. --Boundary_(ID_MUzZrV0aja/CE1sPUNOqxQ) Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT Hi, I have a small prblem i the open call. it fails every time and I dont know why. thanx in advance, Joy.M.M --Boundary_(ID_MUzZrV0aja/CE1sPUNOqxQ) Content-type: text/plain; name=opgen.c Content-transfer-encoding: 7BIT Content-disposition: inline; filename=opgen.c #include #include #include #include #include #include #include const char opcode[]="opcode.sheet"; const char target[]="opcode.sheet"; main() { char buff[8192],temp[10],bin=0,opcode[3]; int fd,fd1,bytes_read=8192,count,i=0,inter_count=0; int offset=0,j=0,tempy; char head[]="OPCODE SHEET"; if((fd=open(opcode, O_RDONLY))==-1) printf("oops"); if((fd1=open(target, O_RDWR|O_CREAT))==-1) printf("O"); while(bytes_read==8192) { bytes_read=read(fd,buff,8192); while(inter_count