This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Copy from one file to another  RSS feed

 
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.

 
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.
 
bacon. tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!