From: bukinm AT inp DOT nsk DOT su (Michael Bukin) Newsgroups: comp.os.msdos.djgpp Subject: Re: Desperately need help with "fopen" Date: Tue, 15 Apr 1997 14:16:27 GMT Organization: BINP SD RAS Lines: 34 Message-ID: <335486e0.7212119@news-win.inp.nsk.su> References: Reply-To: bukinm AT inp DOT nsk DOT su NNTP-Posting-Host: csd-bsdi.inp.nsk.su Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 15 Apr 1997 09:11:41 GMT, Eli Zaretskii wrote: > Thanks. But I wanted to ask you to change the source of `fopen' so that > it tries to call `open' once in compatinility mode, and if that fails, > call it again with DENYNONE bit. Can you please do that and see if that > solves the problem? Yes, it does. Here is a patch that was used: *** src/libc/ansi/stdio/fopen.c Wed Aug 23 03:49:24 1995 --- src/libc/ansi/stdio/fopen.c Tue Apr 15 18:57:02 1997 *************** *** 53,59 **** fd = open(file, oflags, 0666); if (fd < 0) ! return NULL; if (*mode == 'a') lseek(fd, 0, SEEK_END); --- 53,63 ---- fd = open(file, oflags, 0666); if (fd < 0) ! { ! fd = open(file, oflags | SH_DENYNO, 0666); ! if (fd < 0) ! return NULL; ! } if (*mode == 'a') lseek(fd, 0, SEEK_END);