Launching Wget from a Win-10 read-only directory [1] gives
inconsistent error messages.
E.g. wget http://www.watt-32.net/misc/ASMBSW.dll
...
Length: 107008 (105K) [application/x-msdos-program]
ASMBSW.dll: Permission denied
Cannot write to 'ASMBSW.dll' (No error).
----------------
Seems the "Permission denied" is lost when Wget prints "Cannot write to ..."
since the 'errno' from fopen() at http.c (line 2490):
logprintf (LOG_NOTQUIET, "%s: %s\n", hs->local_file, strerror (errno));
gets lost at http.c (line 3993):
logprintf (LOG_NOTQUIET, _("Cannot write to %s (%s).\n"),
quote (hstat.local_file), strerror (errno));
Other cases could trigger the same inconsistent error message.
So what can be done for such a case? Can we push and pop the 'errno'
(for all protocols) somehow?
--------
[1] I tried this in a directory from my old Windows installation thinking it
was safe to write to:
c:\Windows.old\WINDOWS\System32\DriverStore\FileRepository
But no. It is owned by the SYSTEM user. And will remain so until
I run the 'cleanmgr' program.
--
--gv