Date: Thu, 18 Dec 1997 13:42:58 +0200 (IST) From: Eli Zaretskii To: Vik Heyndrickx cc: djgpp-workers AT delorie DOT com Subject: Re: Q?on sharing/locking files In-Reply-To: <3498E0E5.6960@rug.ac.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 18 Dec 1997, Vik Heyndrickx wrote: > But ,why is a trick needed? If a file shouldn't be opened for reading, > then why try to get around that? Because it doesn't make sense to be unable to open a file for read-only access, IMHO. Doing so won't hurt anybody but the one who opened it in read-only mode (if they assume that they see the up-to-date file contents). And Windows actually allows this, *if* you open the file in DENYNONE sharing mode. So `open' in v2.02 first tries to open the file as usual, and if that fails, and if no sharing bits were specified, tries again with DENYNONE. This seems harmless to me, since we play by Windows' rules, we don't lie to it and don't use any sneaky undocumented tricks. > > At least Windows95's VSHARE doesn't allow that, as I described. > > This is incorrect. In compatibility mode all access request are granted > (both files opened in compat. mode) What I saw was that when I have a file open by Less in one DOS box, Emacs in another DOS box cannot save the buffer which visits that file. I have decided, possibly mistakenly, that this is because the open call fails. It might as well be that when Emacs tries to rename the old version, Windows refuses the call; I never dug into Emacs to see what actually fails there. Did you actually try to write to a file that is open by another DOS box, or only to open it? If the latter, please try to write and see if Windows lets you. > It is completely correct, except: > - if one file is opened for reading with DENY_NONE, the other file can > be opened > in compatibility mode as for R, W as RW. > - the '1' and '2', should be simply 'Y' Did you try to read/write, or just to open? > - Win 95 automatically generate FAIL on INT24. That might only be true for DJGPP (DPMI) programs. CWSDPMI does the same. > - It is incomplete (Win95 has a fourth access mode) Can you post the details of this fourth mode?