www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/02/03/07:12:43

Message-Id: <m0xzbYF-000S2dC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Tue, 3 Feb 1998 09:20:32 +0000
MIME-Version: 1.0
Subject: Re: fopen and shared files question
References: <m0xzHm5-000S4NC AT inti DOT gov DOT ar>
In-reply-to: <Pine.SUN.3.91.980203112913.21682D-100000@is>

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

 > >   If I run 2 copies of my editor under Win 3.1 + Share the second copy is
> > totally unable to open the help file because the first one opened it (too
> > bad for me).
> 
> On second thought, something here deeply bothers me.  It seems that I
> can browse the same file in two different DOS boxes on Windows 95 with
> no problems at all.  For example, Less can read the same file from two
> DOS boxes.  So what is different about your editor that you cannot?
The OS that we used.

> Does it open the file in read-only mode?
Yes.
 
> Can you post a simple test program that fails when run on the same
> file in two different DOS boxes?
Any will do it.

Last night I made a program to test almost all the possible cases (a 12x12 
matrix, each cell with 3 flags: Can open, Can read, Can Write).
I didn't finished my research, but I found the following:

Win95 OSR 1 (v4.00.950):
SHARE doesn't affect W95, W95 apllies your own logic and the share flags have a 
a very low importance. They only can restrict a little more the situation, 
like: Open  for read only, but deny write.

Win3.11 (No WfW) + Win32s:
SHARE is very important here. Two tasks can't use the "compat" mode if SHARE is 
loaded. If SHARE isn't loaded all is valid, that means: 1 Task opens for 
read & write, the other the same and the result is that both can read and write 
(very dangerous). With SHARE loaded the share flags are very important.

So the conclution seems to be that the open mode must be adjusted to the OS 
version. I know it sounds stupid and annoying, for this reason I'm trying to 
fill my matrix to find a share flag that solves the problem, but lamentably 
doesn't seems to be a simple solution. The solution (if it exists) will set the 
share flags according to the read & write status. My idea is to emulate the W95 
logic under W3.11 because W95 uses a very good policy.

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019