[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02042] class File acting funny!

From: Clemens Hintze <c.hintze@...>
Date: 2000-03-21 05:08:08 UTC
List: ruby-talk #2042
David Douthitt writes:

...

Sorry for bothering you, but to prevent you from re-inventing the
wheel again, there is a package 'filelock' in the contrib directory in

   ftp://ftp.netlab.co.jp/pub/lang/ruby/contrib/filelock.rb. 

Perhaps it is what you have searched?

But then, nobody has told me if you like to re-invent the wheel again
;-)

...

But, however, let me tell you that I would not derive Lock from File.
You indicate so, that a lockfile is a normal file in first case. All
methods of File would be available to data handling. Is it that what
you intend? Methods like: write, path, print, size, ...

>    * Lock.new insisted on 1 parameter - but initialize method had NO parameters

Because File.new wants to have a parameter. So Lock.new should also
accept one. The simplest would be to define:

     def Lock.new(*dummy)
        ...
     end

BUT you have a problem here. File.new is one of the constructors, that
*DO*NOT* call initialize afterwards. So your Lock#initialize didn't
get called!!!

...

Let the other problems remaining ... :-)

> Thanks for all the help!
> 
> 

\cle

-- 
Clemens Hintze  mailto: c.hintze@gmx.net

In This Thread

Prev Next