From: "Tanes Sriviroolchai" Subject: Re: Bug in djgpp 2.8.0b with open()? References: <353b0193 DOT 4405066 AT news> Organization: NCR (Thailand) Message-ID: <01bd6ea4$8eaf7fc0$ad887fc0@tanes> Newsgroups: comp.os.msdos.djgpp Date: Thu, 23 Apr 1998 06:28:44 -0400 Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I don't know why. However, if you have O_RDONLY, O_WRONLY or O_RDWR ORed with "mode", it works fine. Tanes Sriviroolchai Andreas Kochenburger wrote in article <353b0193 DOT 4405066 AT news>... > Is this a bug in djgpp (downloaded freshly from www.delorie.com).? > > The problem occurs when you run open.exe twice, > i.e. open.tst already exists. > > /* ----------------------------------------------------- > OPEN.C - create or recreate a file > > it works with TC, lcc, gcc 2.8.1 > > but not with djgpp 2.8.0.b Why? > > ----------------------------------------------------- */ > > #include > #include > #include > #include > > int main() { > int code, mode; > mode = O_CREAT | O_TRUNC; > code = open("open.tst",mode,S_IREAD|S_IWRITE); > printf("\nFile open return code: %d ",code); > if (code < 0) printf("(faulty)\007"); > return(0); > } > > --------------------------------------------------- > To reply, change in address: no -> khe, scn <- spam >