[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with spaces in filenames of external programs (gnuplot, less)
From: |
Benjamin Lindner |
Subject: |
Problems with spaces in filenames of external programs (gnuplot, less) |
Date: |
Mon, 29 Sep 2008 19:14:20 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (Windows/20080421) |
Hello,
Using octave version 3.0.2 I ran into problems caused by having spaces
in filenames of gnuplot_binary and PAGER.
The problem is, that the filenames of gnuplot_binary and PAGER must be
quoted whenever they are executed (or a pipe opened to the executable).
Not quoting them results in frequent errors of
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
assuming e.g. that gnuplot_binary is
C:\program files\foo\bar\pgnuplot.exe
(without quotes).
The same applies simiarily to PAGER.
A quick example which triggers the error:
> gnuplot_binary
ans = C:\Program Files\Octave\3.0.2_gcc-4.3.0\bin\pgnuplot.exe
> fid=popen(gnuplot_binary,"w"); fclose(fid);
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
I see two ways of fixing it:
1) force the name of the executables to be quoted. This means
gnuplot_binary would contain
"C:\program files\foo\bar\pgnuplot.exe"
(including the quotes)
This would be simple (for me, that is), but what happens if an already
quoted filename is again quoted upon execution? This just delays the
problem instead of solving it.
2) Ensure that all instances of pipe-opening or program execution quote
the respective file name. I find here with respect of gnuplot the
following two immediatly required changes: __gnuplot_version__.m and
drawnow.m. Additionally the C++ code for the "help" function must be
changed to quote the pager's executable file name.
I'd vote for 2) although it will be more work to track all relevant code
lines and add quotes.
What do you think?
benjamin
- Problems with spaces in filenames of external programs (gnuplot, less),
Benjamin Lindner <=