[GRASS-dev] simplify G_convert_dirseps_to_host(G_tempfile()) ?

Hamish hamish_nospam at yahoo.com
Mon Jun 18 07:02:39 EDT 2007


Paul Kelly wrote:
> > should G_tempfile() be calling G_convert_dirseps_to_host()
> > internally, rather than having individual modules calling it? (ie
> > often forgetting to call it)
> 
> I don't think so - G_convert_dirseps_to_host() only needs to be called
> 
> in certain situations, when the generated path will be used directly
> by external commands on the system. I think to unconditionally call
> it would confuse its purpose. But then again in the longrun it might
> be a good idea to generally simplify things as you said. Hmm, I'm not
> so sure now. But there may be cases which call it and expect to have
> '/' directory separators there for some further processing; I
> wouldn't like to just change it without an audit of where it is used.
> Which modules were you thinking of anyway?


I just added a G_tempfile() call in d.title, now with the -d flag it
does fopen(),fclose() then like G_system("d.text < \"%s\"", tmpfile).


Hamish




More information about the grass-dev mailing list