• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Process Fails but Generated No Exception  RSS feed

 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code fails at the delete step sporatically but I do not get an Exception.

 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read carefully javadoc for File.delete()
http://java.sun.com/javase/6/docs/api/java/io/File.html#delete%28%29
this method does not throw exception, simply returns false in case of failure.
 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ireneusz Kordal wrote:Please read carefully javadoc for File.delete()
http://java.sun.com/javase/6/docs/api/java/io/File.html#delete%28%29
this method does not throw exception, simply returns false in case of failure.


So is there any other way to know why it failed?
 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any more help on this issue?
 
Evan Caballero
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps your are trying to delete the file at the same time another thread is writing into it ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!