Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exception when writting to a readable file  RSS feed

 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3014
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks fot the reply,

Regards,
Ujwwala
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!