drum1981 has asked for the wisdom of the Perl Monks concerning the following question:

hello everyone. can someone suggest an alternate call besides system("copy $_ C:\\FolderB\\$file"); that will also copy sub directories?
  • Comment on copying directories and sub directories

Replies are listed 'Best First'.
Re: copying directories and sub directories
by Roy Johnson (Monsignor) on Jul 25, 2005 at 16:56 UTC
Re: copying directories and sub directories
by itub (Priest) on Jul 25, 2005 at 17:43 UTC
Re: copying directories and sub directories
by radiantmatrix (Parson) on Jul 25, 2005 at 18:07 UTC

    If you're dead set on using a Windows-based command-line tool, xcopy is available by default. I suggest using a module, though, as who knows if/when your code might need to leave the Windows world (or when XCOPY may become deprecated).

    <-radiant.matrix->
    Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law
      ... xcopy is available by default
      Not really important, but it depends on the windows .

        Technically, yes. If you're using anything before Win95, XCOPY may not be available. It's also possible to uninstall it or prevent it from being installed. However, it is part of the default install, and has been since Win95.

        <-radiant.matrix->
        Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
        The Code that can be seen is not the true Code
        "In any sufficiently large group of people, most are idiots" - Kaa's Law