Re: Directory.Copy

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 05/25/04


Date: Tue, 25 May 2004 23:09:27 +0100

Leo <leo@noemail.noemail> wrote:
> I am having a heck of time trying to find the equivalent of Directory.Copy.
>
> Why would they have a Directory.Move and not a Directory.Copy?

Because moving a directory is an atomic operation. Copying a directory
essentially involves copying every file - and there are other methods
which do that.
 
> Please if you have some sample code on copying a Directory it would
> be helpfull.

Basically just find out what's in the directory, and use File.Copy on
each file you want to copy. You may choose to recurse if you want to
copy subdirectories.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: High Tech Kitchen Idea
    ... Beats the heck out of scanning/printing or copying. ... Display recipein kitchen on a digital picture frame. ...
    (rec.food.cooking)
  • Re: High Tech Kitchen Idea
    ... �Beats the heck out of scanning/printing or copying. ... Display recipein kitchen on a digital picture frame. ...
    (rec.food.cooking)
  • Re: Doublespacing
    ... Heck, even within ... I just got used to copying into Notepad as an intermediate step... ... Paul Sture ...
    (comp.sys.mac.system)
  • Directory.Copy
    ... I am having a heck of time trying to find the equivalent of Directory.Copy. ... Please if you have some sample code on copying a Directory it would be helpfull. ... Thanks, Leo ...
    (microsoft.public.dotnet.framework)
  • Re: disabling right click
    ... | photos can't be copied. ... I know that some people are still copying them. ... | Exactly how in the heck are they doing this? ...
    (microsoft.public.frontpage.client)