Shailesh Phatak wrote:This code doesn't throw any exception but according to book it have to throw.
Note: There is no Directory named First Directory in my pC
How do you know it doesn't throw any exceptions? Any exception thrown will be quietly caught and ignored in your code.
Or are you saying that you were able to write out the sentence, read it back, and print it?
Henry