[PD-dev] Tcl exec vs. Microsoft filenames

Hans-Christoph Steiner hans at eds.org
Wed Jan 18 19:36:15 CET 2006


On Jan 18, 2006, at 1:20 AM, Mathieu Bouchard wrote:

> On Wed, 18 Jan 2006, Hans-Christoph Steiner wrote:
>
>> I think its more of a Tcl question.  The problem is that if I run this
>> from the command line, it works fine:
>> rundll32 url.dll,FileProtocolHandler file:C:/Program
>> Files/pd/doc/manuals/Gem/cMatrix.html
>> But if I do this in Tcl, it does not:
>> set filename "C:/Program Files/pd/doc/manuals/Gem/cMatrix.html"
>> exec rundll32 url.dll,FileProtocolHandler [format "file:%s"  
>> $filename] &
>> Quotes don't seem to make it work either.
>
> I don't know the intricacies of the Windows version of Tcl's exec.
>
> Is it possible that %20 gets munged because the shell thinks it's  
> supposed
> to be an argument expansion? I recall that in COMMAND.COM %20 meant  
> like
> what $20 means in /bin/sh... Does the % sign have to be doubled in  
> order
> to make it a literal percentsign for COMMAND.COM ?

Its not an URI, its a Microsoft format, so %20 doesn't work.  It needs  
to be a space, so its a question of how to make Tcl handle the space  
properly.  I think this would be a case for Tcl 8.5's {expand}.  How is  
it done in 8.4?

.hc

________________________________________________________________________ 
____

            "The arc of history bends towards justice."
                                            - Dr. Martin Luther King, Jr.





More information about the Pd-dev mailing list