Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!samsung!olivea!uunet!maserati!scotts From: scotts@qsp.COM (Scott Simpers) Newsgroups: comp.unix.sysv386 Subject: Re: C bug in SCO Unix/ODT 1.0? Keywords: C open creat IO/O Message-ID: <2026@maserati.qsp.UUCP> Date: 18 May 91 02:05:23 GMT References: <814@uswnvg.UUCP> Sender: news@qsp.COM Organization: Quality Software Products, LA, CA Lines: 30 In article <814@uswnvg.UUCP> cjackso@uswnvg.UUCP (Clay Jackson) writes: >I think I've discovered a problem with SCO's ODT Development System Version >1.0 - to wit: ... >int fd; >int mode = 00400; >int o_mode = O_WRONLY|O_CREAT|O_TRUNC; > >fd = open(filename, o_mode, mode); ... >The obove code fails, returning an error code of ENOENT, which, in the >SCO Man pages, is not a documented error for that particular flavor of >open. However: >-- >Clay Jackson - N7QNM >US WEST NewVector Group, Inc >clayj@cjsysv.wa.com | ...uunet!uswnvg!cjackso You say it fails. In what way? Does the file get created? errno does not get reset to 0 if a call succeeds. Try setting errno=0 before the open() call. If you still get a non-zero value in the printf(), then maybe you have a bona-fide problem. I somehow doubt it, though. I've been using O_CREAT in a commercial product for nearly a year now without problems. Scott Simpers Quality Software Products voice: (213)410-0303 5711 W Slauson Avenue Suite 240 fax: (213)410-0124 Culver City, CA 90230 ...uunet!qsp!scotts