gfileutils.h

Go to the documentation of this file.
00001 /* gfileutils.h - File utility functions
00002  *
00003  *  Copyright 2000 Red Hat, Inc.
00004  *
00005  * GLib is free software; you can redistribute it and/or modify it
00006  * under the terms of the GNU Lesser General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or (at your option) any later version.
00009  *
00010  * GLib is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with GLib; see the file COPYING.LIB.  If not,
00017  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  *   Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef __G_FILEUTILS_H__
00022 #define __G_FILEUTILS_H__
00023 
00024 #include <gerror.h>
00025 
00026 G_BEGIN_DECLS
00027 
00028 #define G_FILE_ERROR g_file_error_quark ()
00029 
00030 typedef enum
00031 {
00032   G_FILE_ERROR_EXIST,
00033   G_FILE_ERROR_ISDIR,
00034   G_FILE_ERROR_ACCES,
00035   G_FILE_ERROR_NAMETOOLONG,
00036   G_FILE_ERROR_NOENT,
00037   G_FILE_ERROR_NOTDIR,
00038   G_FILE_ERROR_NXIO,
00039   G_FILE_ERROR_NODEV,
00040   G_FILE_ERROR_ROFS,
00041   G_FILE_ERROR_TXTBSY,
00042   G_FILE_ERROR_FAULT,
00043   G_FILE_ERROR_LOOP,
00044   G_FILE_ERROR_NOSPC,
00045   G_FILE_ERROR_NOMEM,
00046   G_FILE_ERROR_MFILE,
00047   G_FILE_ERROR_NFILE,
00048   G_FILE_ERROR_BADF,
00049   G_FILE_ERROR_INVAL,
00050   G_FILE_ERROR_PIPE,
00051   G_FILE_ERROR_AGAIN,
00052   G_FILE_ERROR_INTR,
00053   G_FILE_ERROR_IO,
00054   G_FILE_ERROR_PERM,
00055   G_FILE_ERROR_FAILED
00056 } GFileError;
00057 
00058 /* For backward-compat reasons, these are synced to an old 
00059  * anonymous enum in libgnome. But don't use that enum
00060  * in new code.
00061  */
00062 typedef enum
00063 {
00064   G_FILE_TEST_IS_REGULAR    = 1 << 0,
00065   G_FILE_TEST_IS_SYMLINK    = 1 << 1,
00066   G_FILE_TEST_IS_DIR        = 1 << 2,
00067   G_FILE_TEST_IS_EXECUTABLE = 1 << 3,
00068   G_FILE_TEST_EXISTS        = 1 << 4
00069 } GFileTest;
00070 
00071 GQuark     g_file_error_quark      (void);
00072 /* So other code can generate a GFileError */
00073 GFileError g_file_error_from_errno (gint err_no);
00074 
00075 gboolean g_file_test         (const gchar  *filename,
00076                               GFileTest     test);
00077 gboolean g_file_get_contents (const gchar  *filename,
00078                               gchar       **contents,
00079                               guint        *length,
00080                               GError      **error);
00081 
00082 
00083 /* Wrapper / workalike for mkstemp() */
00084 int     g_mkstemp            (char         *tmpl);
00085 
00086 /* Wrapper for g_mkstemp */
00087 int     g_file_open_tmp      (const char   *tmpl,
00088                               char        **name_used,
00089                               GError      **error);
00090 
00091 G_END_DECLS
00092 
00093 #endif /* __G_FILEUTILS_H__ */
00094 
00095 

Generated on Tue Jul 5 14:14:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1