This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes exception when writting to a readable file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "exception when writting to a readable file" Watch "exception when writting to a readable file" New topic
Author

exception when writting to a readable file

ujwwala tem
Ranch Hand

Joined: Feb 10, 2010
Posts: 83
Hello All,

In interview there was a question regarding exception name when writting to a readable file,
I answered as if we use setReadonly true and latter check if file.canwritable if it returns true then we can write,

Please guide.

Thanks,
Ujwwala
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2853
    
  11

I think they were going for IOException. By "readable", they might have meant to say "read only". You'll get an IOException if you try to write to a read only file.
ujwwala tem
Ranch Hand

Joined: Feb 10, 2010
Posts: 83
Thanks fot the reply,

Regards,
Ujwwala
 
GeeCON Prague 2014
 
subject: exception when writting to a readable file