> On Feb 1, 2025, at 6:34 AM, Martin McCormick <marti...@suddenlink.net> wrote:
>
> This is perl 5, version 36, subversion 0 (v5.36.0) built for
> x86_64-linux-gnu-thread-multi
> (with 53 registered patches, see perl -V for more detail)
>
> Copyright 1987-2022, Larry Wall
>
> The issue here is trying to copy directories of files
> from the main SSD drive to various thumb drivesthat must be
> mounted on the system for the copy to occur.
>
> The program flawlessly did every single thing I told it to
> so there are up to 4 directories, each with a mounted thumb drive
> sitting there waiting on pins and needles for the gush of
> anticipated data but the only way I've gotten this to work in the
> past is to cheat by using the system command and standard unix
> copying commands as in:
>
> system("cp -p -r \"$docname\" \"/$guides[1]\"/");
>
> The way this program was supposed to copy a disk folder
> to a corresponding thumb drive is written:
>
> dircopy ("\"weekly\", \"/weekly/\"") or die!$;
That should be
dircopy( ("\"weekly\”", "\"/weekly/\"" );
It looks like you are giving dircopy only one argument: "\"weekly\",
\"/weekly/\””. The profile for dircopy is:
dircopy( $orig, $new, [$buf] );
To debug the probem further, write a short-as-possible program that copies a
directory. Something like:
use strict;
use File::Copy::Recursive qw(dircopy);
my $orig = “…”;
my $new = “…”;
dircopy( $orig, $new );
and see what happens.
An easier way to generate a string with embedded quote signs is to use the q
(single quote) or qq (double quotes) functions:
my $double_quotes = qq("weekly", "/weekly/”);
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/