if (!str)
return;
#ifdef G_OS_WIN32
- subst_chars(str, "\t\r\n\\/*:", '_');
+ subst_chars(str, "\t\r\n\\/*?:", '_');
#else
subst_chars(str, "\t\r\n\\/*", '_');
#endif
off_t get_file_size(const gchar *file)
{
+#ifdef G_OS_WIN32
+ GFile *f;
+ GFileInfo *fi;
+ GError *error = NULL;
+ goffset size;
+
+ f = g_file_new_for_path(file);
+ fi = g_file_query_info(f, "standard::size",
+ G_FILE_QUERY_INFO_NONE, NULL, &error);
+ if (error != NULL) {
+ debug_print("get_file_size error: %s\n", error->message);
+ g_error_free(error);
+ g_object_unref(f);
+ return -1;
+ }
+ size = g_file_info_get_size(fi);
+ g_object_unref(fi);
+ g_object_unref(f);
+ return size;
+
+#else
GStatBuf s;
if (g_stat(file, &s) < 0) {
}
return s.st_size;
+#endif
}
time_t get_file_mtime(const gchar *file)
gchar buf2[RFC822_DATE_BUFFSIZE];
t = time(NULL);
- lt = localtime_r(&t, &buf1);
+ if (hidetz)
+ lt = gmtime_r(&t, &buf1);
+ else
+ lt = localtime_r(&t, &buf1);
sscanf(asctime_r(lt, buf2), "%3s %3s %d %d:%d:%d %d\n",
day, mon, &dd, &hh, &mm, &ss, &yyyy);