• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Changes

 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey.
Does anyone know if there is a way to test if a file is open (by another application)? Currently I just get a FileNotFoundException when I try to open a FileInputStream to one. Is there a more suitable Exception, perhaps?
Thanks.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now in the API's this is the Exception that gets thrown if the file does not exist, or for any reason you can not write to it. Locked, Read Only permissions on the file. If you want, you can in your catch determine what the cause of the exception is. If you want more information, you'll have to create your own Exception classes and then extend FileInputStream to do the assessment and throw the appropriate exception.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!