aboutsummaryrefslogtreecommitdiff
path: root/src/gui_backend_local.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-08-28 13:47:56 +0200
committerThomas White <taw@physics.org>2020-08-28 13:49:55 +0200
commit36fb915b8a930ff5f99ecc2854b88f4b10becdd8 (patch)
tree0079c33be885971473349e4ecaebc087ad2495c9 /src/gui_backend_local.c
parent4fec62a6f3f161c6a67229e52c61aedbc5eb0f36 (diff)
Write notes to file
Diffstat (limited to 'src/gui_backend_local.c')
-rw-r--r--src/gui_backend_local.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index 1bf0c9b6..7411c9a2 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -166,6 +166,11 @@ static void *run_indexing(const char *job_title,
struct stat s;
char *workdir;
const char *old_pwd;
+ GFile *workdir_file;
+ GFile *cwd_file;
+ GFile *notes_file;
+ char *notes_path;
+ FILE *fh;
workdir = strdup(job_title);
if ( workdir == NULL ) return NULL;
@@ -182,6 +187,19 @@ static void *run_indexing(const char *job_title,
return NULL;
}
+ cwd_file = g_file_new_for_path(".");
+ workdir_file = g_file_get_child(cwd_file, workdir);
+ g_object_unref(cwd_file);
+
+ notes_file = g_file_get_child(workdir_file, "notes.txt");
+ notes_path = g_file_get_path(notes_file);
+ fh = fopen(notes_path, "w");
+ fputs(job_notes, fh);
+ fclose(fh);
+ g_free(notes_path);
+ g_object_unref(notes_file);
+ g_object_unref(workdir_file);
+
job = malloc(sizeof(struct local_job));
if ( job == NULL ) return NULL;