File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I found something wrong form K&B chapter 6

 
Jack Crifer
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Working with Files and Directories

Create a Reader or a Writer or a Stream. Specifically, create a FileReader, a FileWriter, a PrintWriter, a FileInputStream, or a FileOutputStream. Whenever you create an instance of one of these classes, you automatically create a file, unless one already exists, for instance



I think just like FileInputStream,FileReader ,those INPUT funtion never created any file which is not exist.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be careful when putting something like this up, I have done that many times and most usually it results in wasted time. If you can show us the code that fails to createFile(), we can run the tests that duplicate the failure.

Be sure to run it several times before showing us.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given just the quote you've shown, without any context, you are absolutely right. Constructing a FileReader or FileInputStream will never create a new file. Check the errata page for the book -- this is most likely a known issue.
 
Jack Crifer
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Ernest. where I can get the errata table for the book.

Best Regards.
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find the link to the errata page at the top of this very forum
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic