www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/12/21/06:47:24

Date: Sun, 21 Dec 1997 13:46:38 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Q?on sharing/locking files
In-Reply-To: <349A2FE7.2870@rug.ac.be>
Message-ID: <Pine.SUN.3.91.971221134619.8399L-100000@is>
MIME-Version: 1.0

On Fri, 19 Dec 1997, Vik Heyndrickx wrote:

> Ok, suppose that WinWord wants to open a file for editing: it opens it
> disallowing further read or write access until the editing is done and
> the file has been closed again.

But that's just it: when a program opens a file with the DENYNONE bit,
it does NOT want to deny other accesses.  The problem is that DENYNONE
and the COMPATIBILITY modes are incompatible (beats me why), as far as
the Interrupt List goes.  Your table seems to indicate that the
Interrupt List is in error, but the behavior I describe was reported
by someone who also told that the change in v2.02 made it work for
them.  It might be a good idea to search the DJGPP mail archives for
that thread and see what they were telling exactly, in case that some
special precautions should be observed to reproduce that behavior.

Maybe DOS 7.1 (it's FAT32, right?) has changed something here?  Could
you please send me your test programs so that I could try them on
DOS 7.0?

> If it does not disallow this, a program
> can read this file while it is written, the contents are not only not
> up-to-date but can also be contradictory. e.g. when a djgpp program
> would make a backup of all files in a directory, this behaviour would be
> the most undesirable one.

Like I said, reading a file while it is written to might lead to
``interesting'' results, but it cannot possibly damage the file
system.  IMHO, an OS has no business second-guessing the users as long
as they don't threaten its operation and integrity.

> >             And Windows actually allows this, *if* you open the file in
> > DENYNONE sharing mode.  
> 
> AFAIK the sharing mode does only affect file operations AFTER this
> open.

I mean, if the *second* open is in DENYNONE mode.

> It seems to me that this sharing mode is misinterpreted, or am I
> wrong?

Your table is very different from RB's.  I wonder if DOS 7.1 has
redefined sharing behavior.

> > Did you try to read/write, or just to open?
> 
> Just open. If Windows would allow me to open a file first for writing or
> r/w, and afterwards does not allow me to write to it, I should consider
> this a bug... so I probably better try to write to it.

Right.  That's not the first time we see bugs in MS OSes.

- Raw text -


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