From: Noel O'B. <no...@ca...> - 2005-11-07 11:59:13
|
On Mon, 2005-11-07 at 12:14 +0100, Michael Haggerty wrote: > Hello, > > Thanks for the information and the patch. > > Won't your patch create new problems for filenames that contain > double-quotes? Or is that somehow forbidden? > What if a filename contains single-quotes *and* double-quotes? > > In other words, is there a way to solve this problem in such a way that > it works for *all* legitimate Windows filenames? I have been using this method for my own program's link to Gnuplot (in gausssum.sf.net) for the last year or so, and there have been no reported problems (either in Windows or Linux or Macs). Which may just mean that I have no users, of course :-) The allowed characters are listed here (if you trust Wikipedia): http://en.wikipedia.org/wiki/Filename All listed versions of Windows as well as DOS, disallow " in filenames. Win95 and WinXP allow ' in filenames. Mac and Unix allow any characters except : and / respectively. > Regarding your specific proposed patch: > > 1. I think the conversion of filenames should happen via a call to the > os-specific code. Possibly, but I think the problem is gnuplot specific, not OS specific. Although, I need to test this. I'm in Linux at the moment but I'm not sure how to set up a proper test. I have created files in folders called 'test and "test, but I'm not sure how to go about testing the patch, unless there's an easy way to redirect mkstemp. Maybe changing the TMP environment variable? > 2. string.replace() would be easier than an explicit loop. That's true. Noel |