• Post Reply Bookmark Topic Watch Topic
  • New Topic

Copy from one file to another  RSS feed

 
Smita Chopra
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written some code to copy contents from one file to another but it doesn't work.
Please tell me what's wrong with this code.

 
Mishra Anshu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add these two line as shown in the code :--


See , if you are getting the result.
I have checked it , as it worked.
Here we are just closing the two streams.
 
Smita Chopra
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mishra Anshu:
Add these two line as shown in the code :--


See , if you are getting the result.
I have checked it , as it worked.
Here we are just closing the two streams.


Thanks for replying. It's working now. i guess there was some problem in opening the file in the root. I changed the path to /usr/local and now its working
 
Mishra Anshu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gr8

did it work without closing the stream ?
I mean you added this line or not ?

 
Smita Chopra
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mishra Anshu:
Gr8

did it work without closing the stream ?
I mean you added this line or not ?



Yes it even workd without closing the stream.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!