From: Mike Hall Date: 2003-07-27T00:45:57+09:00 Subject: Re: Confused about locking a file via file.flock(File::LOCK_EX) Mark J. Reed wrote: >There is no *mandatory* file locking mechanism on UNIX. >It's always possible to just ignore any locks and open a file >for writing. I have to disagree. SVR2 had it way back when, and Linux used to, last time I checked a few years ago. As I recall, I could put a mandatory lock on a file, and even 'cat' would object. * Mandatory locking o kernel enforces lock requests o access to records is controlled by the kernel o open, close, read, write system calls honor the locks o requires SGID bit set, with group-execute bit cleared + chmod u+rw,g+rws-x,o+rw file o in Linux, requires a MAND_LOCK mounted filesystem + mount -o remount,mand /filesystem + mount -o remount,nomand /filesystem o a write-lock prevents _any_ process from reading that section I have no idea what AIX supports in this regard.