#include <stdio.h>
#include <stdlib.h>
+#include <data/file-name.h>
#include <libpspp/str.h>
#include "fwriteerror.h"
if (journal_file == NULL)
{
if (journal_file_name == NULL)
- journal_file_name = xstrdup ("pspp.jnl");
+ {
+ const char *output_path = default_output_path ();
+ journal_file_name = xasprintf ("%s%s", output_path, "pspp.jnl");
+ }
journal_file = fopen (journal_file_name, "w");
if (journal_file == NULL)
{
fputs (line, journal_file);
if (strchr (line, '\n') == NULL)
putc ('\n', journal_file);
+ fflush (journal_file);
}