aboutsummaryrefslogtreecommitdiff
path: root/src/gui_backend_local.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-02-18 10:41:29 +0100
committerThomas White <taw@physics.org>2021-02-18 11:16:58 +0100
commit240f9e7311497c15386d0b62242f6747a24ac7bc (patch)
tree4da1ed098324700b2f9d00ab4e76a08f4de9f4b2 /src/gui_backend_local.c
parentf8607b2e931bda6a33e6a1170abafaeeb0eb0750 (diff)
Eliminate duplicate make_job_folder/make_workdir
Diffstat (limited to 'src/gui_backend_local.c')
-rw-r--r--src/gui_backend_local.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index 26eda1ed..8cad40c3 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -35,6 +35,7 @@
#include <utils.h>
+#include "crystfel_gui.h"
#include "gui_project.h"
#include "gui_index.h"
#include "gui_merge.h"
@@ -167,50 +168,6 @@ void setup_subprocess(gpointer user_data)
}
-static GFile *make_job_folder(const char *job_title,
- const char *job_notes)
-{
- struct stat s;
- char *workdir;
- GFile *workdir_file;
- GFile *cwd_file;
- GFile *notes_file;
- char *notes_path;
- FILE *fh;
-
- workdir = strdup(job_title);
- if ( workdir == NULL ) return NULL;
-
- if ( stat(workdir, &s) != -1 ) {
- ERROR("Working directory already exists. "
- "Choose a different job name.\n");
- return NULL;
- }
-
- if ( mkdir(workdir, S_IRWXU) ) {
- ERROR("Failed to create working directory: %s\n",
- strerror(errno));
- return NULL;
- }
-
- cwd_file = g_file_new_for_path(".");
- workdir_file = g_file_get_child(cwd_file, workdir);
- g_object_unref(cwd_file);
-
- /* Write the notes into notes.txt */
- 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);
-
- return workdir_file;
-}
-
-
-
static struct local_job *start_local_job(char **args,
const char *job_title,
GFile *workdir_file,