Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

renameTo() and delete() not working  RSS feed

 
jenny bou
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that similar problems have been posted before but they don't solve my problem.
I'm calling renameTo() on a file object, problem is it gets deleted only some of the time.
I'm creating a new file object for a file that already exists on the machine and then trying to rename it but it only works sometimes. I then tried to delete the file but that doesn't always work either. Here's my code:

[Code formatted by Peter Tran]

[This message has been edited by Peter Tran (edited November 15, 2001).]
 
Krishna Moorthy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
even i have faced the same problem. up to my knowledge, i think somewhere u are not closing the streams which u have opened. check it and if any of the streams left unclosed. close it and then try. it will work fine in this case.

Originally posted by jenny bou:
[B]I know that similar problems have been posted before but they don't solve my problem.
I'm calling renameTo() on a file object, problem is it gets deleted only some of the time.
I'm creating a new file object for a file that already exists on the machine and then trying to rename it but it only works sometimes. I then tried to delete the file but that doesn't always work either. Here's my code:

[Code formatted by Peter Tran]

[This message has been edited by Peter Tran (edited November 15, 2001).][/B]

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!