I haven't been able to download using PID for ages....

dinkypumpkin dinkypumpkin at gmail.com
Mon Oct 1 08:12:06 EDT 2012

On 01/10/2012 10:26, Mark Rogers wrote:
> So this is just out of curiosity: Shouldn't the backslashes be escaped?
> Ie C:\\Downloads\\BBC? (Or indeed C:\\Downloads\\BBC\\ which would also
> then be valid?)

Valid, but unnecessary.  The Windows command interpreter hands the path 
to get_iplayer as-is, without the need for escaped backslashes.

The OP's inadvertently escaped quote made it think the argument value 
wasn't yet complete, so it kept concatenating the rest of the command 
line looking for the terminating quote.  Of course, get_iplayer couldn't 
interpret that concatenation as recognisable arguments so it just listed 
the cache contents.  Your Linux shell would helpfully open a 
continuation prompt if you omitted a terminating quote, but at the 
Windows command prompt we still party like it's 1981.

> Isn't the fact that it works without, just down to lucky choices of
> following characters, or is there something special about escaped
> quotes? I'm thinking of paths like C:\test (where \t could be seen as
> "tab" not "backslash followed by t".

No luck involved.  The Windows command interpreter just passes the path 
to Perl as a string, where it is interpreted as a directory path.

> Would switching to forward slashes work (C:/Downloads/BBC) on Windows? I
> know that many of the underlying Windows/DOS libraries support this.

It would work (at least for Perl apps), but there's no harm in 
supporting native Windows conventions as well.  Internally, get_iplayer 
uses File::Spec to handle paths portably.

More information about the get_iplayer mailing list