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

problem with file rename  RSS feed

 
Rehana Shaik
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am having two file objects with different files one is reader and one is writer after some process i closed both streams and i deleted one file object after that i tried to rename other one with deleted filename but it is returning false. please help me
thanks in advance
 
Vijayakumar Arya
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Just put the Thread on sleep for around 250ms, before renaming the file, as disk IO normally takes some time to complete.
We have experienced the same thing and we did this as a fix.
 
Rehana Shaik
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!