From: Travis Whitton Date: 2003-07-26T00:40:51+09:00 Subject: Re: Confused about locking a file via file.flock(File::LOCK_EX) Flock only works within the same process. For example, if you had 2 concurrent versions of your program running, the second version would wait for the first version to release the lock before it opened the file. To my knowledge, there isn't any guaranteed way to lock all other processes out of a file, but I could be wrong. HTH, Travis Whitton In article <20030725151907.12347.qmail@web20802.mail.yahoo.com>, Ludwigi Beethoven wrote: > I am writing a ruby appl under AIX where I need to > update the /etc/hosts table. I would like to make sure > that during my update nobody else can update that > file. I thought I found a solution to my problem with > the flock method. However, it does not appear to do > what I thought it will do. To test it, I wrote a > simple ruby piece of code that, first locks the file, > second spin-loop forever while I open another window > and vi the "locked" file. Well, I am able to vi and > change the file that is supposed to be locked. > ruby -v returns: ruby 1.6.7 (2002-03-01) > [powerpc-aix4.3.3.0] > > Any ideas?? > > Thank you > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com >