A bug in preferences handling (in 2.83)

Jeremy Nicoll - ml get_iplayer jn.ml.gti.91 at wingsandbeaks.org.uk
Wed Jul 24 12:44:15 EDT 2013


dinkypumpkin <dinkypumpkin at gmail.com> wrote:

>You have to respect the rules of the Windows command processor and 
>escape the backslash:
>
>get_iplayer --prefs-add --output "H:\\"

That would be fair enough if it were true... but it isn't.  The Windows
command-line escape character is caret ("^"). 

Various online references to the command shell etc say this, as does:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true
(in the Notes just before 'Nesting command shells'), and it's certainly what
I've used before when building long command-lines programmatically.


Windows commands certainly don't use backslash as an escape; that's clearly
the case because it's used all over the place in commands, as it crops up in
all filepaths.


I think perl is applying unix-style character processing to the command-line
it sees after that's been passed to it by Windows.   That's also the
conclusion drawn at
http://stackoverflow.com/questions/7939642/escaped-double-quote-side-effect-in-windows-command-prompt
though you have to discount the initial ramblings written by people trying
to understand command-line parsing from a unix/ linux point of view.  The
bottom answer on the page is the correct one.


I understand that this is 'working as designed' as far as perl is concerned,
and probably no-one from a unix/linux background would see it as a problem.
But I think there might be some point in documenting somewhere that commands
written at the Windows command prompt have first to get through Windows'
shell processing (with one set of rules) and will then be interpreted by
perl with an alien set of rules.

-- 
Jeremy Nicoll - my opinions are my own.



More information about the get_iplayer mailing list