On Fri, Dec 10, 2021 at 10:40:05AM -0600, Craig A. Berry wrote: > On Fri, Dec 10, 2021 at 6:44 AM Salvador Fandiño <sfandino@gmail.com> wrote: > > > > On 10/12/21 11:37, Nicholas Clark wrote: > > > > > 2) Are curl and wget likely to be found on Win32? Is there any command line > > > tool that a HTTP::TIMTOWTDI module can shell out to, to deal with https? > > > > > > > This works for me on Windows 10: > > > > bitsadmin /rawreturn /transfer perl /download ^ > > https://www.cpan.org/src/5.0/perl-5.34.0.tar.gz ^ > > c:\users\salva\perl2.tgz > > > > > > Also, urlmon.dll provides URLDownloadToFile: > > > > $d = Win32::API->new(urlmon => URLDownloadToFileA => 'NPPNN', 'N'); > > $d->Call(0, "https://www.cpan.org/src/5.0/perl-5.34.0.tar.gz", > > 'c:\users\salva\perl3.tgz', 0,0); > > > > Those look promising. It appears that PowerShell's Invoke-WebRequest, > Invoke-RestMethod, and Start-BitsTransfer could all do the job as > well. > > Very recent versions of Windows include OpenSSH, but I don't think > it's enabled by default, so sftp is probably not a practical > alternative (if that's even enabled on the server side). > > I like the urlmon solution since it doesn't even involve spawning an > external command, but Win32::API is not in core, is it? So bitsadmin > might be the simplest and most reliable solution. Assuming Microsoft's online fine manuals are accurate, bitsadmin is only Windows 10 or later, whereas urlmon is XP or later. I don't think that bundling Win32::API is a great idea, but a minimal XS module to wrap what we need does feel like a win here. There doesn't seem to be one on CPAN (yet). Not only am I not competent to write such a thing, I can't even volunteer to have a go at something like "Markov chains and a regression test", as I don't have access to anything Win32 to try it out. Nicholas ClarkThread Previous | Thread Next