• Post Reply Bookmark Topic Watch Topic
  • New Topic

file renaming...

 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a file, already on the hard drive (basicCustomerInfo) and another file (rewritten) which I'd like to rename to basicCustomerInfo, getting rid of the original basicCustomerInfo file and replacing it with the contents of rewritten. It doesn't rename it and replace the contents. I saw that trying to rewrite a file while input and output streams are open is a common problem, so I made sure they were all closed properly. It still doesn't rename with the new contents. Does anyone have any idea what I might be doing wrong?


[ March 20, 2006: Message edited by: Brandi Love ]
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible that the file might still be in use somewhere else?
 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That doesn't seem to be the case, I closed everything. I checked the other code I wrote that uses these files but I've closed all the input and output, as far as I can see. Could it be possible that the file is in use within another class and that is causing the problem? Maybe I'm missing something...

Here's the code that I wrote, I bolded the relevant stuff.


[ March 20, 2006: Message edited by: Brandi Love ]
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also try closing the FileReaders. I'm not sure if that will fix it, but it might.
 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried closing everything, still gettin' the error.



I'll try playing around and testing it, there must be something I'm missing somewhere.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!