A. Fig Lee wrote:vc wrote:A. Fig Lee wrote:На Солярке ага, производит еррор.
Кстати, на FreeBSD ета система не сработала.
fcntl rules без всяких мандатори локс.
OK, so you proved that Solaris 9 has mandatory locking and FreeBSD (whatever it is) does not.
Что значит "мандатори локинг"? fcntl работает.
It's unclear what you mean by 'fcntl works'. Sure it works for co-operating processes (as flock/lockf would). But since you want to protect your file from being overwritten by any arbitrary process, fcntl would not 'work' in FreeBSD precisely because the OS does not implement mandatory locking.
A. Fig Lee wrote:Хммм... Тот лок что Вы тут описывали и пропагандировали имплементед сверху fcntl.
Если fcntl просто интерфейс, то flock и подавно.
You should read what I wrote more carefully -- I used lockf (which is indeed a simplified interface to fcntl), not flock, but that's beside the point as fcntl would not 'work' for non-cooperating processes under FreeBSD anyway. A 'cp', for example, will happily overwrite a 'locked' file in FreebSD, lock or no lock.
VC