[M3devel] random-acces I/O

Olaf Wagner wagner at elegosoft.com
Sun Mar 2 11:53:57 CET 2008


Quoting Dragiša Durić <dragisha at m3w.org>:

> On Fri, 2008-02-29 at 17:41 -0500, hendrik at topoi.pooq.com wrote:
>>   ? Are there methods for locking the file -- or portions of it --
>>     against simutaneous access by other programs, including ones written
>>     in other languages?
>
>   There are. But you have to make some rules, and follow them from all
> users of your file.

File.T provides lock() and unlock() methods. You must be aware though
that file locking is inherently depending on operating system and
file system, and as far as I know there is not the slightest chance
of a general applicable specification of locks. In CM3, the POSIX
target use the POSIX advisory file locking, as far as I know, which
means that only those interested in heeding the lock will see it.
Nobody will prevent others from reading or writing the file.

On Windows, the default behaviour for NTFS is completely different;
on FAT file systems there are probably no locks at all.

If your files are located on an NFS share, locking depends on
the implementation of the rpc.lockd on the server and on the quality
of the NFS client; for SMBFS/SAMBA, it depends both on the onderlying  
file system and on the configuration of SAMBA.

If anybody knows of a commonly available locking abstraction, I'd
be interested in it, too.

Olaf
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list