robocopy equivalent in C#

  • Thread starter Thread starter NikhilSinghal
  • Start date Start date
N

NikhilSinghal

Hi,
I am building an application that requires copy a decent number of files
around. Till now, to demonstrate the prrof of concept, I used pInvoke to
invoke robocopy to do all the heavy lifting.

Is there any .Net component that I can build/download/buy that will allow me
basic robocopy features such as retry, wait, mirror, file ACL's copy, etc.

Thanks,
Nikhil Singhal
 
Nikhil,

There might be, but it's not included out-of-the box.

You say you are calling the RoboCopy components through the P/Invoke
layer. Why not just continue to call them through the P/Invoke layer?
 
I would have loved to continue the use the ribustness of robocopy, but there
are redistribution, packaging issues. Furthermore, requiring the customers to
download something before they can run my app is just not pleasing my bosses.

I would love to hear your other solutions.

Thanks
Nikhil

Nicholas Paldino said:
Nikhil,

There might be, but it's not included out-of-the box.

You say you are calling the RoboCopy components through the P/Invoke
layer. Why not just continue to call them through the P/Invoke layer?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

NikhilSinghal said:
Hi,
I am building an application that requires copy a decent number of files
around. Till now, to demonstrate the prrof of concept, I used pInvoke to
invoke robocopy to do all the heavy lifting.

Is there any .Net component that I can build/download/buy that will allow
me
basic robocopy features such as retry, wait, mirror, file ACL's copy, etc.

Thanks,
Nikhil Singhal
 
Nikhil,

Out of curiosity, what is it that robocopy does that normal copy
wouldn't do?
I understand that Robocopy is a special purpose solution for file
copying.

Does the normal copying affect things in any way that makes you use
robocopy?
Also, if your network (intranet) is open - you can keep a network
share that has robocopy executables.

You can than call robocopy executable from your .net application.

HTH
Kalpesh
 
Some of the specific features of robocopy that make it interesting are the
1. retry
2. wait
3. mirror
4. copy ACL's

The goal is to remove dependency from robocopy binary. These machines would
be in a production data center and will be tightly locked down.

Thanks
Nikhil
 
Well your bosses are wrong if you have to create something you can already
get with no investment.

If your software was going into one of my datacentres I would make sure that
the components needed were delivered and installed, whether there was 1 item
or 1000. Robocopy is one of those trusted components used in datacentres
all over the place and it would simply be added to whatever build approach
was needed. Its simply a pre-requisite.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
I 100% agree with you John.

Do you know what the re-distribution policy on Robocopy is?
Can I bundle it with my app?

Thanks
Nikhil
 
Most likely, the management "may" decide in future to charge for this tool.

Do you know of any .Net based API's that have similar functionality as
robocopy?

Thanks
Nikhil
 
Adding to what John said, Robocopy is now a system utility (Vista and up) is
replaces xcopy which is deprecated.
Charging for something that is part of the system is not obviously
permitted.
If you want to implement this functionality yourself, you will have to dive
into the System.IO classes to start with. Beware that Robocopy took a large
amount of development effort, don't think (why would you?) you will be able
to build something similar in a couple of days.

Willy.
 
I completely agree with you guys. As a developer, I feel the same way. I
fought a lot, but lost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top