Hi,

Regarding the bug report for gettext:
https://lists.gnu.org/archive/html/bug-gettext/2013-09/msg00010.html

javacomp.c has the following code to check if javac can compile some
Java programs.  First, it writes out some code snippet to a temporary
file and then call javac command on the written file.  Like this:

 write_temp_file (tmpdir, conftest_file_name,
                  get_goodcode_snippet (source_version));

 ...

 java_sources[0] = conftest_file_name;
 compile_using_javac (java_sources, 1, ...);

write_temp_file opens the file with fopen_temp and close it with
fwriteerror_temp at the end:

 static bool
 write_temp_file (struct temp_dir *tmpdir, const char *file_name,
                  const char *contents)
 {
   FILE *fp;

   register_temp_file (tmpdir, file_name);
   fp = fopen_temp (file_name, "w");
   ...
   if (fwriteerror_temp (fp))
 }

As fopen_temp uses "D" mode on Windows, which implies the file will be
deleted on close (fwriteerror_temp here).  Thus, after calling
write_temp_file, the file will be deleted immediately.  Maybe we should
use plain fopen/fwriteerror here?

Regards,
-- 
Daiki Ueno

Reply via email to