[#11156] How to delete methods from superclass? — Clemens Hintze <c.hintze@...>
Hello,
25 messages
1998/12/01
[#11157] Re: How to delete methods from superclass?
— matz@... (Yukihiro Matsumoto)
1998/12/01
Hi, Clemens.
[#11176] English List [Re: How to delete methods from superclass?]
— gotoken@... (GOTO Kentaro)
1998/12/01
In message "[ruby-list:11157] Re: How to delete methods from superclass?"
[#11177] Re: English List [Re: How to delete methods from superclass?]
— Clemens Hintze <c.hintze@...>
1998/12/01
Hello Gotoken,
[#11178] Re: English List [Re: How to delete methods from superclass?]
— "Kikutani, Makoto" <kikutani@...>
1998/12/01
Hi, Clemens.
[#11180] Re: English List [Re: How to delete methods from superclass?]
— matz@... (Yukihiro Matsumoto)
1998/12/02
Hi, All.
[#11183] Re: English List [Re: How to delete methods from superclass?]
— Kikutani Makoto <kikutani@...>
1998/12/02
On Wed, Dec 02, 1998 at 01:09:40PM +0900,
[#11165] usage of Time class — Noritsugu Nakamura <nnakamur@...>
6 messages
1998/12/01
[#11206] variable $0 — ISII takesi <isii@...>
石井です
8 messages
1998/12/03
[#11207] $LOAD_PATH — ISII takesi <isii@...>
石井です
14 messages
1998/12/03
[#11211] Re: $LOAD_PATH
— matz@... (Yukihiro Matsumoto)
1998/12/03
まつもと ゆきひろです
[#11227] Re: $LOAD_PATH
— ISII takesi <isii@...>
1998/12/06
石井です。
[#11219] クラス定数の継承 — Yoshiki WADA <wada@...>
和田といいます。
6 messages
1998/12/03
[#11225] ruby and ISP — Noritsugu Nakamura <nnakamur@...>
9 messages
1998/12/06
[#11245] undefined local variable or method `__END__' (Cygwin 版 1.1c9) — たむら けんいち <t9655832@...>
8 messages
1998/12/08
[#11246] Re: undefined local variable or method `__END__' (Cygwin 版 1.1c9)
— WATANABE Hirofumi <watanabe@...>
1998/12/08
わたなべです.
[#11250] Ruby 用語集 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
25 messages
1998/12/08
[#11318] Re: Ruby 用語集
— Noritsugu Nakamura <nnakamur@...>
1998/12/14
[#11324] Re: Ruby 用語集
— KIMURA Koichi <kimura@...>
1998/12/14
[#11325] ruby on Win32 (Re: Ruby 用語集 )
— Koji Oda <oda@...1.qnes.nec.co.jp>
1998/12/15
小田@QNES です。
[#11257] comp.lang.* — Noritsugu Nakamura <nnakamur@...>
12 messages
1998/12/10
[#11265] Re: comp.lang.*
— "Kikutani, Makoto" <kikutani@...>
1998/12/10
「いしや株式会社」にはやられましたな〜。
[#11274] Re: comp.lang.*
— matz@... (Yukihiro Matsumoto)
1998/12/11
まつもと ゆきひろです
[#11258] require error? — OHARA Shigeki <os@...>
大原といいます。
12 messages
1998/12/10
[#11266] Re: require error?
— Yamada Kenji <kyamada@...>
1998/12/10
[#11269] 京都 (Re: [ruby-dev:3789] Re: List()) — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
21 messages
1998/12/11
[#11299] Re: 京都
— MAEDA Shugo <shugo@...>
1998/12/12
前田です。
[#11308] Re: 京都
— matz@... (Yukihiro Matsumoto)
1998/12/14
まつもと ゆきひろです
[#11312] Re: 京都
— Kazuhiro HIWADA <hiwada@...>
1998/12/14
ひわだです
[#11334] Re: 京都
— Motoyuki Kasahara <m-kasahr@...>
1998/12/15
笠原です。こんにちは。
[#11336] Re: 京都
— matz@... (Yukihiro Matsumoto)
1998/12/15
まつもと ゆきひろです
[#11276] pstore.rb — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
5 messages
1998/12/11
[#11309] ext/ICQ 0.1 released — jkuro@...
黒田@大変な会社です。
6 messages
1998/12/14
[#11323] How to use GTK::timeout? — Takao KAWAMURA <kawamura@...>
gtkモジュールのtimeoutメソッドはどうやって使うのか教えて頂け
6 messages
1998/12/14
[#11337] Re: ruby on Win32 (Re: Ruby 用語集 ) — 助田 雅紀 <masaki.suketa@...>
助田です.
6 messages
1998/12/15
[#11348] sub or gsub の第2引数について — 石田 宏香 <h-ishida@...>
いしだです.
7 messages
1998/12/15
[#11349] Re: sub or gsub の第2引数について
— matz@... (Yukihiro Matsumoto)
1998/12/15
まつもと ゆきひろです
[#11364] Re: sub or gsub の第2引数について
— kjana@... (YANAGAWA Kazuhisa)
1998/12/15
In message <199812150559.OAA32348@picachu.netlab.co.jp>
[#11350] Re: ruby on Win32 (Re: Ruby 用語集 ) — 助田 雅紀 <masaki.suketa@...>
助田です.
9 messages
1998/12/15
[#11382] Hi. — kuma@... (Koji Kumagai)
5 messages
1998/12/17
[#11390] fep.rb — ttate@...
立石です。
6 messages
1998/12/18
[#11391] gtk — Takehama Hirohisa <thiro@...>
Ruby/Gtk に関して質問があります。
10 messages
1998/12/20
[#11392] Re: gtk
— "D.Kanda" <MAP2303@...>
1998/12/21
[#11395] Re: gtk
— Takehama Hirohisa <thiro@...>
1998/12/21
かんださん、ありがとうございます。
[#11393] mod_ruby — shugo@... (Shugo Maeda)
前田です。
28 messages
1998/12/21
[#11394] Re: mod_ruby
— matz@... (Yukihiro Matsumoto)
1998/12/21
まつもと ゆきひろです
[#11398] Re: mod_ruby
— shugo@... (Shugo Maeda)
1998/12/21
前田です。
[#11399] RE: mod_ruby
— OZAWA Sakuro <crouton@...>
1998/12/21
さくです。
[#11408] Re: Be port
— shugo@... (Shugo Maeda)
1998/12/22
前田です。
[#11409] Re: Be port
— matz@... (Yukihiro Matsumoto)
1998/12/22
まつもと ゆきひろです
[#11410] SMP (Re: Re: Be port)
— IWAMURO Motonori <iwa@...>
1998/12/22
岩室@富士通です。
[#11412] Re: SMP (Re: Re: Be port)
— ARIMA Yasuhiro <fit0298@...>
1998/12/22
Regard to "[ruby-list:11410] SMP (Re: Re: Be port)"
[#11404] djgpp 版と cygnusWin32 版の違いについて — 石田 宏香 <h-ishida@...>
いしだです.
6 messages
1998/12/22
[#11447] "\\1".upcase — gotoken@... (GOTO Kentaro)
ごとけんです
5 messages
1998/12/25
[#11454] Dir クラスの delete メソッド — URA Takefumi <tura@...>
はじめまして,浦と申します。よろしくお願いします。
5 messages
1998/12/25
[#11464] ruby and IDE — Noritsugu Nakamura <nnakamur@...>
18 messages
1998/12/27
[#11465] goto (Re: ruby and IDE)
— ttate@...
1998/12/27
立石です。
[#11466] Re: goto (Re: ruby and IDE)
— matz@... (Yukihiro Matsumoto)
1998/12/27
まつもと ゆきひろです
[#11472] call/cc (Re: goto)
— shugo@... (Shugo Maeda)
1998/12/28
前田です。
[#11473] call/cc (Re: goto)
— gotoken@... (GOTO Kentaro)
1998/12/28
ごとけんです
[#11478] Re: call/cc (Re: goto)
— matz@... (Yukihiro Matsumoto)
1998/12/28
まつもと ゆきひろです
[#11468] Ruby 1.2 FreeBSD port — Yasuhiro Fukuma <yasuf@...>
福間@福岡 です。
7 messages
1998/12/28
[ruby-list:11326] Forward: ANNOUNCEMENT: filelock.rb (long)
From:
matz@... (Yukihiro Matsumoto)
Date:
1998-12-15 00:54:47 UTC
List:
ruby-list #11326
まつもと ゆきひろです
ruby-talkでClemens氏がfilelock.rbを発表しました.
本人に希望により ruby-list にもフォワードします.
------- Start of forwarded message -------
Date: Mon, 14 Dec 1998 23:24:48 +0000 (Local time zone must be set--see zic manual page)
From: Clemens Hintze <c.hintze@gmx.net>
Subject: [ruby-talk:00095] ANNOUNCEMENT: filelock.rb (long)
To: ruby-talk@netlab.co.jp (ruby-talk ML)
Hello all,
with help from matz and all of you who'ved answered my newbie
questions, I am now able to announce my filelock.rb module. It should
already be located at:
ftp://ftp.netlab.co.jp/pub/lang/ruby/contrib
If you find any error, or if you have any improvement proposal, please
let me know. My email address is:
mailto:c.hintze@gmx.net
Following I have inserted the filelock.README to enable you to figure
out the area for that filelock.rb could be used.
Much fun,
Cle.
____________________________filelock.README________________________________
filelock.rb 0.1 (c) C.Hintze 22nov1998
This module provides two classes to deal with lockfiles.
Instances of LockFile represents real lockfiles. Mostly these file have the
extension ".lock". If the instance is not any longer needed, the instance will
delete the lockfile during finalization.
Instances of LockedFile provides a possibility to open a certain file and
handle the lockfile mechanism transparent for the user. If a LockedFile is not
any longer needed, it will be closed, and the corresponding LockFile instance
will be removed during finalization.
What is it?
===========
Sometimes it is not possible to use fctl mechanism to lock/unlock files. May
it be, that fctl doesn't properly work on a given UNIX, may it be that your
file resides on a mounted filesystem. UNIX mail delivery system itself use a
lock mechanism via lockfiles. For every file I want to lock, a corresponding
<file>.lock file is created. If such a lockfile already exists, than the
process have to wait until the lock was released (lockfile deleted) or have to
steal the lock to have access on that certain file.
Why you may need it?
====================
If, for example, you want to process your system mailbox, it may happen that
while you are reading your mailbox, a new mail arrives. While you reading your
mailbox, there is probably no problem. But if you also want to write your
mailbox this may create a big desaster.
Here you can use the LockedFile wrapper object. If you obtain the lock and
then process your mailbox, you can be sure that in this very moment no write
access from your mail delivery system will occur, until you close that file
and therefore release the lock. See the function test2 at the bottom of the
file, to see, how you COULD do it, if the module mailread.rb would
allow other objects than derived from IO to serve as input.
Algorithm:
==========
If there is no another lock, the lockfile will be created. Otherwise, it
must be decided whether the lock should be stolen or not.
If the lock should not be stolen, the process will sleep for sleep seconds
and then check, whether the existant lock is vanished or not. If not it
sleeps again for sleep seconds, ... etc. This all would be done for retry
times or forever if retry is nil.
If the lock should be stolen, then the process will first sleeps for steal
seconds. Then the lockfile of the other process will be removed. After that,
the process again sleeps suspend seconds, to give the process from which the
lock was stolen, the possibility to steal it back. If the other process
has not stolen back its lock, the lockfile will be created. That all would be
done for retry times or forever if retry is nil.
If the lock could not be obtained after retry retries, an AcquireLockError
will be thrown.
Additonal Features:
===================
The methods LockedFile::open and LockFile::create_for are able to deal with
blocks like File::open does.
LockedFile::open will hands over the reference to the LockedFile instance as
parameter to the block and execute it. After executing, the LockedFile will
be closed and the lock will be released.
WARNING: You should not reopen the file within the block. Doing so will
raise a FrozenLockError.
LockFile::create_for will hands over a stolen lock checker lambda. You can
invoke it with <reference>.call. It will return true, if the lock was
stolen in the meantime; false otherwise.
After the block is finished, the lock will be released if it was not
stolen in the meantime.
WARNING: You may unlock the lock explicity within the block, but you cannot
obtain it again. Trying to do so will result in a FrozenLockError exception
raised.
Examples:
=========
1. Read in a whole UNIX mailbox. During the read-in, no new mail can be
delivered by the UNIX mailsystem.
contents = LockedFile::open(mailbox) { |mb| mb.read() }
2. Another way to safety deal with your mailbox:
LockFile::create_for(mailbox) do |not_ok|
fd = open(mailbox, "r+")
... # Do what you want with it. Filter mails, delete them
... # It's up to you! But don't forget to call the checker
... # regulary with not_ok.call
fd.close
end
Here is a concrete but useless example:
require "filelock"
require "mailread"
FileLock::LockFile::create_for(ARGV[0]) do |not_ok|
fp = open(ARGV[0])
until fp.eof? or not_ok.call
mail = Mail.new(fp)
print "Subj=#{mail.header['Subject']}\n"
sleep 1
end
print "Lock was stolen!\n" if not_ok.call
fp.close
end
But much more safety would be the following (NOT POSSIBLE USING
Ruby 1.1c9!):
require "filelock"
require "mailread"
fp = FileLock::LockedFile::open(ARGV[0])
begin
until fp.eof?
mail = Mail(fp)
print "Subj=#{mail.header['Subject']}\n"
sleep 1
end
rescue FileLock::StolenLockError
print "Lock was stolen!\n"
ensure
fp.close
end
Here the fact, that the lock was stolen, will be recognized on the
soonest time possible, whereas in the first example, it will be only
recognized during execution of until! That perhaps could be too late!!!
Copyright notice
================
This source is copyrighted, but you can freely use and copy it as long as you
don't change or remove the copyright notice:
Now coming to the warranty. There is no warranty! Never and in no case ;-)
I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I BE LIABLE FOR
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
To-do:
- Improve the speed, although I don't know how :-}
Bugs:
- Slow compared with Ruby's file objects, as on every access it has to
been checked, whether the lock is still valid yet.
I have used the Python version of that module for some time without
encoutering any problem. As Ruby is very new for me, and I have to adapt
certain things to Ruby's way of doing, I don't know, if I have all done
correct. Furthermore I have added some new features not contained in
the Python's version. So certainly there should be some errors.
Please let me know, if you find one.
mailto:c.hintze@gmx.net
Describe what you have tried to do, and the contents of the version string
contained in the variable version on top of the file.
Please do not forget to attach an example, where the error occurs to enable
me to reproduce the error.
------- End of forwarded message -------