To explain why I wanted to do this in the first place, I've just
started helping with the Ruby part of the work being done under the
PLEAC project at SourceForge.

In case people haven't heard about this (I only discovered it yesterday
and there seems to be only one other person doing Ruby code for it),
the plan is to write equivalent code, in various languages, for each of
the recipes in the O'Reilly "Perl Cookbook".

In perl one can do things like

   open(DATA, ">> data")

to open the file "data" for append.  Similarly with "> file", "< file",
"+> file", "+< file" etc.

As far as I know, this syntax isn't available in Ruby, so I thought it
would be interesting to show how it could be easily added.  I was able
to write the code by defining a class method with a different name, but
figured it would be nicer if one could add the functionality to File.open
directly, by using an alias for the original open method.

With the explanations Dave and Guy have provided, I now have this
working.

Of course, I fully expect someone to point out that this is already
implemented and hence I've wasted my time :-).

I had fun writing it, anyway.  One of the reasons I decided to get
involved with the project was that I thought it would force me to learn
more about Ruby ... and that's already happened!