[PD-dev] Tcl exec vs. Microsoft filenames

Martin Peach martinrp at vax2.concordia.ca
Mon Jan 23 22:36:57 CET 2006


Martin Peach wrote:

> 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 tried the following simple script on WinXP and it works fine here 
> (Tcl for Windows Tcl 8.4.11, Tk 8.4.11) using File->Source... from the 
> Console that shows up when you type "wish" on a command line:
>
> #!/usr/bin/wish
>
> puts "Hello"
> set filename "C:/Program Files/pd/doc/gem/manual/index.html"
> exec rundll32 url.dll,FileProtocolHandler [format "file:%s" $filename] &
>
> ... then my browser opens the URL 
> "file:///C:/Program%20Files/pd/doc/gem/manual/index.html".
> It also works if I just enter the name of the script in a command 
> prompt window.


Further testing shows that while a path like "C:/Program 
Files/pd/doc/gem/manual/index.html" is processed correctly, in pd.tk the 
actual path is something like "C:/Program 
Files/pd/bin/../doc/gem/manual/index.html" and this kind of path doesn't 
work if there are spaces. I would think this is a bug in tcl/tk and not 
pd, but it might be more elegant to make the help pathnames by stripping 
the "bin" from pd_guidir instead of appending "..".

Martin




More information about the Pd-dev mailing list