From: Noam Noam Date: 2006-08-31T00:03:12+09:00 Subject: Re: problem using pstore with multi-users thanks Kirk, i didn't understand what do you meen by "under a user " how can i solve this problem? the output error "premisson denied" pops up from some of the threads (randomally) and not from all of them, so i figured its because to many threads attemps to write to the pstore file in the same time, isn't it? Thanks again, Noam unknown wrote: > On Wed, 30 Aug 2006, Noam Noam wrote: > >> Hi all, >> when i'm using pstore with multi-users: >> Permission denied - ../comments.dat.new >> it seems that more then one user is asking to use the same file. >> i tried to use synchronize for locking the transaction until it finsh, >> but it seems that i can not using it when i using pstore. >> any one having any idea??? >> Thanks. > > pstore doesn't itself do any locking of any sort. > > If you have multiple threads or processes that might try to use pstore > on > the same file at the same time, you will have to handle the locking > yourself. > > If you aren't on Windows, I suggest Ara Howard's lockfile.rb if you are > doing multiprocess work. If it is multithreaded, you certainly can use > a > mutex to synchronize access. > > http://codeforpeople.com/lib/ruby/lockfile/ > > However, permission denied suggests a simple file permissions problem > that > locking will not solve, so I suggest you take a look at whether you > might > accidentally be be creating the pstore file under a user or with > permissions that you don't intend. > > > Kirk Haines -- Posted via http://www.ruby-forum.com/.