in reply to Re: copying files with system()
in thread copying files with system()

using this code:
#!D:\perl\bin\perl use File::Copy; $listFile = "list.txt"; open(LIST, $listFile) || die "Cant open $listFile : $!"; while(<LIST>) { copy("\\\\$_\\c$\\testtxt.txt,C:\\resologs,"); } close(LIST);
I get this error: Usage: copy(FROM, TO , BUFFERSIZE) at C:\scripts\perl\GetLogFiles2.pl line 9. Does anyone know what i am doing wrong?

Replies are listed 'Best First'.
Re: Re: Re: copying files with system()
by lshatzer (Friar) on Jul 20, 2001 at 01:46 UTC
    As ichimunki said in (ichimunki) Re: copying files with system(), you can just use regular unix type pathes such as copy("/testtxt.txt", "/resologs/");, to avoid having to escape the path for windows.

    update:
    Taken from CB: <tye> copy("file1,file2") is not the same as copy("file1","file2")