[PD-dev] Tcl exec vs. Microsoft filenames

Hans-Christoph Steiner hans at eds.org
Sun Jan 22 19:36:36 CET 2006


On Jan 17, 2006, at 2:12 PM, Martin Peach wrote:

> Hans-Christoph Steiner wrote:
>
>>
>> This is win32.  rundll32 url.dll,FileProtocolHandler doesn't like   
>> "file:C:/Program%20Files" from my tests.  This is Microsoft we are   
>> talking about, they do things their own way, standards be damned.
>>
> I can't find any real docs on url.dll but it seems like  
> FileProtocolHandler expects a file path.
> Did you try:
> exec rundll32 url.dll,FileProtocolHandler \
>                [format "file:\"%s\"" $filename] &
> yet?
>
> Another solution is to use short names:
> (e.g., using ``applba~1.def'' instead of ``applbakery.default''),  
> which can be obtained with the *file attributes $fileName -shortname*  
> command.
> (from http://www.tcl.tk/man/tcl8.4/TclCmd/exec.htm)
> Martin

We have a winner!  This worked for me:

exec rundll32 url.dll.FileProtocolHandler \
	[format "file:%s" [file attributes $filename -shortname]] &

.hc

>
>
>> .hc
>>
>> On Jan 17, 2006, at 1:26 PM, B. Bogart wrote:
>>
>>> yuck, URIs don't have spaces, you put one in a web-page you its   
>>> replaced
>>> with %20 in the URI.. I guess you could have to replace spaces with  
>>> %20
>>> and see if that works.
>>>
>>> Try just opening the file in a browser and note the URL it uses to   
>>> open it.
>>>
>>> I assume this happens on win32, but its been too long for me to  
>>> know...
>>>
>>> .b.
>>>
>>> Hans-Christoph Steiner wrote:
>>>
>>>>
>>>> In u_main.tk, in the procedure menu_openhtml, this little snippet of
>>>> code does not work when there is a space in the file name (i.e.
>>>> C:/Program Files/pd/doc), but works fine when there are no spaces:
>>>>
>>>>           exec rundll32 url.dll,FileProtocolHandler \
>>>>                 [format "file:%s" $filename] &
>>>>
>>>> This opens HTML, etc from the menu/help browser, so it would be most
>>>> helpful to have it working.  I have tried a number of things to no   
>>>>  avail.
>>>>
>>>> Any Tcl-meisters want to take a stab?  Matju?
>>>>
>>>> .hc
>>>>
>>>> ____________________________________________________________________ 
>>>> __ __
>>>> ____
>>>>
>>>>  As we enjoy great advantages from inventions of others, we should  
>>>> be
>>>> glad of an opportunity to serve others by any invention of ours; and
>>>> this we should do freely and generously.
>>>>                                                   - Benjamin  
>>>> Franklin
>>>>
>>>>
>>>> _______________________________________________
>>>> PD-dev mailing list
>>>> PD-dev at iem.at
>>>> http://lists.puredata.info/listinfo/pd-dev
>>>>
>>>>
>>
>> ______________________________________________________________________ 
>> __ ____
>>
>> Man has survived hitherto because he was too ignorant to know how to   
>> realize his wishes.
>> Now that he can realize them, he must either change them, or perish.
>>                                                         -William  
>> Carlos  Williams
>>
>>
>> _______________________________________________
>> PD-dev mailing list
>> PD-dev at iem.at
>> http://lists.puredata.info/listinfo/pd-dev
>>
>>

________________________________________________________________________ 
____

                             http://at.or.at/hans/






More information about the Pd-dev mailing list