Number: 138
Title: spaces in pathnames on Windows
Submitter: Glenn Tesler
Date: Fri Apr 26 17:12:51 2002
Subsys: Dotty/Lneato/Lefty
Version: 1.8
System: x86-Other-Windows XP
Severity: minor
Problem:
I would like to set up file extensions so that clicking on a graphviz dot file in a directory listing or a browser window with a hyperlink to a local file, will run dotty. I'm also going to try this on other platforms, so any general advice would be useful. Here's a specific problem in doing this on Windows.

Clicking on a file is essentially equivalent to running the command line with the full path:

dotty C:Documents and SettingsgpteslerMy Documentsfoo.gvz

(since .dot is a Microsoft Word template file, I use .gvz instead) and the spaces cause it to split the filename into several filenames and put up an alert window Lefty Panic cannot open input file: and

OK

Experimenting directly from a command line, I tried putting quotes around the filename, which sometimes cures such situations: dotty "C:Documents and SettingsgpteslerMy Documentsfoo.gvz"

but I got the same error.

However, using the "8dot3" version of the filename works: dotty C:Docume~1gpteslerMyDocu~1foo.gvz

The Windows API call GetShortPathName should let you get that automatically from the string that has the spaces in it.

This affects other graphviz components, too, not just dotty.
Comments:
[erg] As described above, dotty splits a single argument, such as "one two.dot" into two. Perhaps this happens because of an additional parsing between dotty and lefty.

[erg] The fix at least allow one to quote the filename. Presumably, if the GUI hands dotty a filename with a space which is not seen as a single argument, it will still get split. One could argue that it should be the responsibility of the GUI to do the mapping, not every program. This is reminiscent of the MS approach where each program does its own globbing, rather than providing it in the shell.
Owner: ek
Status: Fixed (7 April 2005)