• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

renameTo() and delete() not working

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]


 
What? What, what, what? What what tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic