On Mon, 5 Mar 2012 08:47:27 -0500
Richard Hipp <d...@sqlite.org> wrote:

[...]
> > It seems the program is started with parameters like
> > "/temp/xDjd8RXRlXyBTEo /temp/RgKiAnjkXUrB61Z", and I can see some
> > temporary files like this created, but obviously winmerge cannot
> > pick them up.
> >
> > Some things I don't understand:
> >
> > -- why '/temp' on Windows? Obviuosly this does not use an
> > environment variable. I have such a directory, but what if I hadn't?
> >
> 
> See http://www.fossil-scm.org/fossil/artifact/3e15b2476f1e?ln=861-903
> for the current algorithm for finding temporary filenames.  How would
> you suggest that this code be improved?
Windows code is expected to use GetTempPath() [1] and
GetTempFileName() [2] API calls.  Probably a way to go would be to use
two source files implementing file_tempname(): one having the current
implementation (for POSIX systems) and another one for Windows--which
would call GetTempFileNameW() to obtain a temporary file name and
then recode it to UTF-8 using a call to WideCharToMultiByte() [3].

I also wonder: why is custom code used on POSIX instead of mktemp()?

1. http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992.aspx
2. http://msdn.microsoft.com/en-us/library/windows/desktop/aa364991.aspx
2. http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130.aspx
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to