4 Replies - 6960 Views - Last Post: 22 December 2012 - 09:39 AM Rate Topic: -----

#1 moh_tmp  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 19-November 12

What is the best in file copy?

Posted 22 December 2012 - 05:48 AM

I am creating an apllication to copy some files
what is the best way to copy them

  • My.Computer.FileSystem.CopyFile
  • System.IO.File.Copy
  • IO.FileStream



Or there is a better way?

What is the defference between them?
Thanks very much.
Is This A Good Question/Topic? 0
  • +

Replies To: What is the best in file copy?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: What is the best in file copy?

Posted 22 December 2012 - 08:05 AM

I would suggest you consider this a good learning experience. You will face this question hundreds of times in your life as a programmer: Which method is best x or y? So accept that you're not always going to be able to turn to your co-worker and ask them for the answer. You're going to have to start doing some of your own empirical testing one day. And this is an easy one to practice those skills on.

Make up a quickie little test form that copies a 10 gig directory filled with a few thousand files from A to B with a timer running using method 1. Then that same source directory A to C using method 2. And again from A to D using method 3.

Not only will you get comfortable doing your own testing and confirmation but you'll learn 3 different ways to code for the same need.
Was This Post Helpful? 3
  • +
  • -

#3 moh_tmp  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 19-November 12

Re: What is the best in file copy?

Posted 22 December 2012 - 08:46 AM

Thank you very much for your advice

But I still want to ask
Is there another way for copying files
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: What is the best in file copy?

Posted 22 December 2012 - 08:51 AM

Those are the biggies that I'm aware of
Was This Post Helpful? 1
  • +
  • -

#5 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: What is the best in file copy?

Posted 22 December 2012 - 09:39 AM

Just to add a little to tlhIn`toq's excellent advice...

For timing, check out the Stopwatch Class.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1