2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 #include <gconf/gconf-client.h>
26 static char *cc_file_dir;
28 #define ALTOS_DIR_PATH "/apps/aoview/log_dir"
29 #define DEFAULT_DIR "AltOS"
32 cc_file_save_conf(void)
34 GConfClient *gconf_client;
37 gconf_client = gconf_client_get_default();
40 gconf_client_set_string(gconf_client,
44 g_object_unref(G_OBJECT(gconf_client));
49 cc_file_load_conf(void)
52 GConfClient *gconf_client;
55 gconf_client = gconf_client_get_default();
58 file_dir = gconf_client_get_string(gconf_client,
61 g_object_unref(G_OBJECT(gconf_client));
63 cc_file_dir = strdup(file_dir);
68 cc_set_log_dir(char *dir)
70 cc_file_dir = strdup(dir);
79 cc_file_dir = cc_fullname(getenv("HOME"), DEFAULT_DIR);
86 cc_make_filename(int serial, int flight, char *ext)
97 (void) localtime_r(&now, &tm);
98 cc_mkdir(cc_get_log_dir());
102 snprintf(seq, sizeof(seq), "-seq-%03d", sequence);
106 snprintf(base, sizeof (base), "%04d-%02d-%02d-serial-%03d-flight-%03d%s.%s",
114 full = cc_fullname(cc_get_log_dir(), base);
115 r = access(full, F_OK);