Is File.open deprecated?

X

Xeno Campanoli

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...?
 
X

Xeno Campanoli

Xeno said:
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
 
R

Rick DeNatale

I don't see it mentioned in the File chapter of the latest Pickaxe book? = =A0Is
this just a mistake? =A0I would think it would be mentioned as deprecated
otherwise...??? =A0Apparently 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.


--=20
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
 
X

Xeno Campanoli

Rick said:
It's actually Io_Open, and File which is a subclass of IO inherits it.

It's documented on page 549.
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
 
R

Rick DeNatale

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

No, it's not on my page 549. =A0I've got instance methods pid through put= c on
that page, and open nowhere to be found...

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

xc



--=20
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top