Date: Sun, 6 Apr 1997 13:15:33 +0300 (IDT) From: Eli Zaretskii To: Robert Hoehne cc: djgpp AT delorie DOT com Subject: Re: HELP: cannot read file while opened in word!?! In-Reply-To: <3344BC20.56EC@Mathematik.tu-chemnitz.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 4 Apr 1997, Robert Hoehne wrote: > At first it is required, that Word uses the file > with the correct sharing flags set. (under W95 > you don't need to load share.exe). And from the > DJGPP program (your program) you have to open the > file with the _dos_open() (I don't know if it possible also > with fopen) function and give there explicit the > sharing flags for opening the file (these are > the SH_... constants from fcntl.h). Please read > the doc about that function for more details. I don't understand this. `_dos_open' doesn't do anything significantly different from `_open' (called by `fopen'), so why should the effect be different? Are you sure `_open' doesn't work also? One thing that I would suggest is trying to set the DENYNONE bit in the access/sharing mode byte. That might allow some access to the file. Of course, if Word opens the file so that nobody else can access it, nothing will work.