need help with Windows command line

Devs, (and Bob especially,)
Our efforts to make Inkscape's Windows port not output errors on the console have been way too successful. Now it never ouputs ANYTHING to the console, ever. Not even if I redirect it to file (> file).
Now, however, I have a project that critically depends on querying SVG files with Inkscape using --query* command line options. Worst of all, this must run on Windows.
So my question is, is there any simple fix I can do to make this work (I don't mind to run a custom version of Inkscape for this project)?
Or, should I just add --query-output=file option which would make it write the output to a file, which I can then parse?
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org

bulia byak wrote:
Devs, (and Bob especially,)
Our efforts to make Inkscape's Windows port not output errors on the console have been way too successful. Now it never ouputs ANYTHING to the console, ever. Not even if I redirect it to file (> file).
Now, however, I have a project that critically depends on querying SVG files with Inkscape using --query* command line options. Worst of all, this must run on Windows.
So my question is, is there any simple fix I can do to make this work (I don't mind to run a custom version of Inkscape for this project)?
Or, should I just add --query-output=file option which would make it write the output to a file, which I can then parse?
It would be much better to fix this properly. --query-output=file IMHO would be evil. If you need a quick work around try `inkscape --query-whatnot > file`.
Aaron Spike

On 1/26/06, Aaron and Sarah Spike <spike@...749...> wrote:
It would be much better to fix this properly. --query-output=file IMHO would be evil. If you need a quick work around try `inkscape --query-whatnot > file`.
Does not work either, unfortunately. For some reason it then tries to open the files named ">" and "file" and fails.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org

Quoting bulia byak <buliabyak@...400...>:
On 1/26/06, Aaron and Sarah Spike <spike@...749...> wrote:
It would be much better to fix this properly.
--query-output=3Dfile IMHO
would be evil. If you need a quick work around try `inkscape --query-whatnot > file`.
Does not work either, unfortunately. For some reason it then tries to open the files named ">" and "file" and fails.
Ah... hmm, what are you writing your script in, and how are you calling Inkscape?
-mental

On 1/26/06, mental@...3... <mental@...3...> wrote:
Ah... hmm, what are you writing your script in, and how are you calling Inkscape?
I tried both the standard windows command interpreter and bash from cygwin, the result is the same in both. I haven't even started scripting as such, I'm just trying various command lines - I don't think it will be any different in a .bat file or bash script.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org

bulia byak wrote:
Our efforts to make Inkscape's Windows port not output errors on the console have been way too successful. Now it never ouputs ANYTHING to the console, ever. Not even if I redirect it to file (> file).
Sounds like bug #1282541 - Windows: commandline args don't display anything http://sourceforge.net/tracker/index.php?func=detail&aid=1282541&gro...
Windows command prompt doesn't bind stdin/stdout of gui application to anything useful, doesn't wait for them to terminate and thus cannot show you any output from them (unless you use redirects or pipes. strange that that didn't work for you).
Now, however, I have a project that critically depends on querying SVG files with Inkscape using --query* command line options. Worst of all, this must run on Windows.
So my question is, is there any simple fix I can do to make this work (I don't mind to run a custom version of Inkscape for this project)?
You can make a custom version which is a console application instead of a gui application by simply changing -mwindows into -mconsole in Makefile.mingw.common. But since Inkscape really is a gui application you will now have to explicitly link some libraries, -lgdi32 and -lcomdlg32 seems to do it for me.

On 1/26/06, Ulf Erikson <ulferikson@...400...> wrote:
You can make a custom version which is a console application instead of a gui application by simply changing -mwindows into -mconsole in Makefile.mingw.common. But since Inkscape really is a gui application you will now have to explicitly link some libraries, -lgdi32 and -lcomdlg32 seems to do it for me.
Thanks for the pointer! I'll try it and see if it helps. Do you compile on Windows with these changes, or cross-compile on Linux?
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org

bulia byak wrote:
On 1/26/06, Ulf Erikson <ulferikson@...400...> wrote:
You can make a custom version which is a console application instead of a gui application by simply changing -mwindows into -mconsole in Makefile.mingw.common. But since Inkscape really is a gui application you will now have to explicitly link some libraries, -lgdi32 and -lcomdlg32 seems to do it for me.
Thanks for the pointer! I'll try it and see if it helps. Do you compile on Windows with these changes, or cross-compile on Linux?
I tested it on Windows only with the 0.43 source, but I don't think that would matter much.
There was a similar discussion about making gui apps output to the console over at Cygwin some time ago. Might be of interest?
participants (4)
-
unknown@example.com
-
Aaron and Sarah Spike
-
bulia byak
-
Ulf Erikson