file-utils.h (1771B)
1 /* 2 * Claws Mail -- a GTK based, lightweight, and fast e-mail client 3 * Copyright (C) 1999-2024 the Claws Mail team and Colin Leroy 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef __CLAWS_IO_H__ 20 #define __CLAWS_IO_H__ 21 22 #include <stdio.h> 23 #include <glib.h> 24 25 gint file_strip_crs (const gchar *file); 26 gint append_file (const gchar *src, 27 const gchar *dest, 28 gboolean keep_backup); 29 gint copy_file (const gchar *src, 30 const gchar *dest, 31 gboolean keep_backup); 32 gint copy_file_part_to_fp (FILE *fp, 33 off_t offset, 34 size_t length, 35 FILE *dest_fp); 36 gint copy_file_part (FILE *fp, 37 off_t offset, 38 size_t length, 39 const gchar *dest); 40 gint canonicalize_file (const gchar *src, 41 const gchar *dest); 42 gchar *file_read_to_str (const gchar *file); 43 gchar *file_read_stream_to_str (FILE *fp); 44 45 gint copy_dir (const gchar *src, 46 const gchar *dest); 47 FILE *my_tmpfile (void); 48 FILE *get_tmpfile_in_dir (const gchar *dir, 49 gchar **filename); 50 FILE *str_open_as_stream (const gchar *str); 51 gint str_write_to_file (const gchar *str, char *file); 52 53 gint prefs_chmod_mode (gchar *chmod_pref); 54 55 56 #endif