On Wed, 17 May 2000 [EMAIL PROTECTED] wrote:
> Date: Wed, 17 May 2000 20:58:09 MET_DST
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: File Locking and Dosemu vs M$DOS
>
> > We have Dosemu 0.98 running in a multi-user environment. Each
> > user boots from the dame "c:" boot image (M$DOS) and loads the SHARE.
>
> SHARE is useful on file server only - i.e. if the DOS session is
> to provide file access for the network. Do not load it otherwise.
>
> > The (clipper) application we are trying to run has the annoying habit
> > of attempting to delete a file to see if there are any other users.
> > You see, under M$DOS sharing, when you open a file it is locked
> > and no-one can delete it until you close it. (stupidly) this
> > application is relying on this behaviour!
>
> And Linux allows deleting it (in fact, it is deleyed delete:
> the file is removed from the directory, but still remains and
> can be accessed by these who opened it previously; I don't know
> if there is a way to make directory entry for it then).
>
> > My question is: Has this behaviour changed in ver 1.0 ?? If so I
>
> I doubt it very much. There are many problems with file access
> sharing in DOSEMU and I suppose still need definition what is
> needed. I know about problems with region lock/unlock, file open
> modes (just what SHARE is for), it is yet another problem. There
> is no simple fix: Linux handles delete differently from DOS.
It should be possible to make DOSEMU behaviour similar to plain DOS;
I do not know, how to make this well - each of my ideas have some
problems (file below refers to a file on a local Linux filesystem);
1. Select some magic offset beyond end of real file (should be
run-time configurable perhaps). Once a file is opened in DOSEMU session
place a shared lock for 1-byte region at this offset;
Remove file operation would be translated to:
open file
place an exclusive lock at said region
remove file
close it
Problems with this method are that there is no guarantee that DOS apps
will not use the same offset for locking
2. For each accessed file make a zero-length flag file named like the
original file plus some suffix (would not work with filesystems allowing
only short file names)
; MFS would be modified in such a way that this flag files would not be
visible under DOSEMU
for each file opened the flag file would be also opened and shared
file lock placed
Remove file operation would be translated to:
open flag file,
place exclusive file lock on it
remove original file
close flag file and remove it
3. Similar to 2., only flag files would have identical names, but
be located in a separate directories tree - mapping would have to be
somehow specified to dosemu;
This might be made more general by using region locks rather than file
locks - we would then have opportunity to implement DOS-specific open
modes, etc.
Comments?
>
> Jerzy
>
Regards,
Wojtek