1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 3 /* 4 * File-Roller 5 * 6 * Copyright (C) 2001, 2003 Free Software Foundation, Inc. 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 #ifndef FILE_UTILS_H 23 #define FILE_UTILS_H 24 25 #include <sys/types.h> 26 #include <time.h> 27 #include <unistd.h> 28 #include <gio/gio.h> 29 30 /* path */ 31 32 char * _g_path_get_temp_work_dir (const char *parent_folder); 33 34 /* GFile */ 35 36 gboolean _g_file_query_is_file (GFile *file); 37 gboolean _g_file_query_is_dir (GFile *file); 38 goffset _g_file_get_file_size (GFile *file); 39 time_t _g_file_get_file_mtime (GFile *file); 40 time_t _g_file_get_file_ctime (GFile *file); 41 const char* _g_file_get_mime_type (GFile *file, 42 gboolean fast_file_type); 43 gboolean _g_file_is_temp_dir (GFile *file); 44 GFile * _g_file_create_alternative (GFile *folder, 45 const char *name); 46 GFile * _g_file_create_alternative_for_file (GFile *file); 47 gboolean _g_file_check_permissions (GFile *file, 48 int mode); 49 gboolean _g_file_make_directory_tree (GFile *dir, 50 mode_t mode, 51 GError **error); 52 gboolean _g_file_remove_directory (GFile *directory, 53 GCancellable *cancellable, 54 GError **error); 55 GFile * _g_file_new_user_config_subdir (const char *child_name, 56 gboolean create_); 57 GFile * _g_file_get_dir_content_if_unique (GFile *file); 58 guint64 _g_file_get_free_space (GFile *file); 59 GFile * _g_file_get_temp_work_dir (GFile *parent_folder); 60 gboolean _g_file_is_temp_work_dir (GFile *file); 61 gboolean _g_file_query_dir_is_empty (GFile *file); 62 gboolean _g_file_dir_contains_one_object (GFile *file); 63 64 /* program */ 65 66 gboolean _g_program_is_in_path (const char *filename); 67 gboolean _g_program_is_available (const char *filename, 68 gboolean check); 69 70 /* GKeyFile */ 71 72 void _g_key_file_save (GKeyFile *key_file, 73 GFile *file); 74 75 #endif /* FILE_UTILS_H */ 76