Jan Dubois wrote: >On Thu, 16 Jun 2005, Steve Hay wrote: > > >>We could scan through $ENV{PATH} (before clearing it!) looking for >>bcc3250mt.dll, but even then we can't copy it using system() quite as >>easily as Cygwin because Win32 doesn't actually have a copy executable >>-- it is built into the shell... which also doesn't have a predictable >>name (cmd.exe, command.com) or location. >> >> > >I don't quite understand this. system() on Win32 will invoke the command >via the shell automatically if it cannot run it directly. You even can >bypass the attempt to run without the shell by using any of the shell >meta characters <>|%"' in your command. > >Anyways, if the copy command didn't work, then this is a bug. > Well, I'm really confused now.
A simple test program shows that system("copy ...") does indeed work fine, even with tainting on and $ENV{PATH} cleared (as per op/taint.t). However, with this diff against blead: ==== //depot/perl/t/op/taint.t#66 - C:\p5p\bleadperl\t\op\taint.t ==== @@ -142,9 +142,12 @@ } } if (defined $bcc_dir) { - require File::Copy; - File::Copy::copy("$bcc_dir/cc3250mt.dll", '.') or - die "$0: failed to copy cc3250mt.dll: $!\n"; + $bcc_dir =~ /^(.*)$/; + $bcc_dir = $1; + $bcc_dir =~ s|/|\\|g; + $ENV{PATH} = ''; + system("copy $bcc_dir\\cc3250mt.dll .") && + die "$0: failed to copy $bcc_dir\\cc3250mt.dll: $!\n"; eval q{ END { unlink "cc3250mt.dll" } }; I find that op/taint.t dies, failing to do the copy: op/taint.t: failed to copy C:\Borland\BCC55\Bin\cc3250mt.dll: No such file or directory Given that C:\Borland\BCC55\Bin\cc3250mt.dll does exist I assumed that it was compaining that it can't find a binary called "copy". Does the above diff work for you? If not, why not? I can't figure it out. ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.