Is File.open deprecated?

I don’t see it mentioned in the File chapter of the latest Pickaxe book?
Is
this just a mistake? I would think it would be mentioned as deprecated
otherwise…??? Apparently I use File.new instead, but it seems like
File.open
is worth leaving around…?

Xeno C. wrote:

I don’t see it mentioned in the File chapter of the latest Pickaxe
book? Is this just a mistake? I would think it would be mentioned as
deprecated otherwise…??? Apparently I use File.new instead, but it
seems like File.open is worth leaving around…?
It looks like the answer of my question is on page 162. Apparently it
still is
in use as a regular class method, and works a little differently from
“new”, and
just got left out of the main “File” method definitions.

I am interested in any further comments on this that can reaffirm my
sanity in
this matter.

xc

Rick DeNatale wrote:

No, it’s not on my page 549. I’ve got instance methods pid through putc
on that
page, and open nowhere to be found…

Ah, wait, it’s a class method not an instance method: IT’s on Page 540
in this
edition (Programming Ruby 1.9).

xc

On Wed, Jan 6, 2010 at 7:30 PM, Xeno C.
[email protected] wrote:

I don’t see it mentioned in the File chapter of the latest Pickaxe book? Is
this just a mistake? I would think it would be mentioned as deprecated
otherwise…??? Apparently I use File.new instead, but it seems like
File.open is worth leaving around…?

It’s actually IO.open, and File which is a subclass of IO inherits it.

It’s documented on page 549.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

It’s page 549 of the PDF version, my dead tree version is upstairs.

On Wed, Jan 6, 2010 at 7:59 PM, Xeno C.
[email protected] wrote:

xc


“It’s the preponderance, stupid!” - Professor Stephen Schneider, IPCC member


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale