1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 various file-related functions.
7 <!-- ##### SECTION Long_Description ##### -->
12 <!-- ##### SECTION See_Also ##### -->
17 <!-- ##### ENUM GFileError ##### -->
19 Values corresponding to <literal>errno</literal> codes returned from file operations
20 on UNIX. Unlike <literal>errno</literal> codes, #GFileError values are available on
21 all systems, even Windows. The exact meaning of each code depends on what
22 sort of file operation you were performing; the UNIX documentation
23 gives more details. The following error code descriptions come
24 from the GNU C Library manual, and are under the copyright
29 It's not very portable to make detailed assumptions about exactly
30 which errors will be returned from a given operation. Some errors
31 don't occur on some systems, etc., sometimes there are subtle
32 differences in when a system will report a given error, etc.
35 @G_FILE_ERROR_EXIST: Operation not permitted; only the owner of the
36 file (or other resource) or processes with special privileges can
37 perform the operation.
38 @G_FILE_ERROR_ISDIR: File is a directory; you cannot open a directory
39 for writing, or create or remove hard links to it.
40 @G_FILE_ERROR_ACCES: Permission denied; the file permissions do not
41 allow the attempted operation.
42 @G_FILE_ERROR_NAMETOOLONG: Filename too long.
43 @G_FILE_ERROR_NOENT: No such file or directory. This is a "file
44 doesn't exist" error for ordinary files that are referenced in
45 contexts where they are expected to already exist.
46 @G_FILE_ERROR_NOTDIR: A file that isn't a directory was specified when
47 a directory is required.
48 @G_FILE_ERROR_NXIO: No such device or address. The system tried to
49 use the device represented by a file you specified, and it
50 couldn't find the device. This can mean that the device file was
51 installed incorrectly, or that the physical device is missing or
52 not correctly attached to the computer.
53 @G_FILE_ERROR_NODEV: This file is of a type that doesn't support
55 @G_FILE_ERROR_ROFS: The directory containing the new link can't be
56 modified because it's on a read-only file system.
57 @G_FILE_ERROR_TXTBSY: Text file busy.
58 @G_FILE_ERROR_FAULT: You passed in a pointer to bad memory.
59 (GLib won't reliably return this, don't pass in pointers to bad
61 @G_FILE_ERROR_LOOP: Too many levels of symbolic links were encountered
62 in looking up a file name. This often indicates a cycle of symbolic
64 @G_FILE_ERROR_NOSPC: No space left on device; write operation on a
65 file failed because the disk is full.
66 @G_FILE_ERROR_NOMEM: No memory available. The system cannot allocate
67 more virtual memory because its capacity is full.
68 @G_FILE_ERROR_MFILE: The current process has too many files open and
69 can't open any more. Duplicate descriptors do count toward this
71 @G_FILE_ERROR_NFILE: There are too many distinct file openings in the
73 @G_FILE_ERROR_BADF: Bad file descriptor; for example, I/O on a
74 descriptor that has been closed or reading from a descriptor open
75 only for writing (or vice versa).
76 @G_FILE_ERROR_INVAL: Invalid argument. This is used to indicate
77 various kinds of problems with passing the wrong argument to a
79 @G_FILE_ERROR_PIPE: Broken pipe; there is no process reading from the
80 other end of a pipe. Every library function that returns this
81 error code also generates a `SIGPIPE' signal; this signal
82 terminates the program if not handled or blocked. Thus, your
83 program will never actually see this code unless it has handled or
85 @G_FILE_ERROR_AGAIN: Resource temporarily unavailable; the call might
86 work if you try again later.
87 @G_FILE_ERROR_INTR: Interrupted function call; an asynchronous signal
88 occurred and prevented completion of the call. When this
89 happens, you should try the call again.
90 @G_FILE_ERROR_IO: Input/output error; usually used for physical read
91 or write errors. i.e. the disk or other physical device hardware
93 @G_FILE_ERROR_PERM: Operation not permitted; only the owner of the
94 file (or other resource) or processes with special privileges can
95 perform the operation.
96 @G_FILE_ERROR_FAILED: Does not correspond to a UNIX error code; this
97 is the standard "failed for unspecified reason" error code present in
98 all #GError error code enumerations. Returned if no specific
101 <!-- ##### MACRO G_FILE_ERROR ##### -->
103 Error domain for file operations. Errors in this domain will
104 be from the #GFileError enumeration. See #GError for information on
110 <!-- ##### ENUM GFileTest ##### -->
112 A test to perform an a file using g_file_test().
115 @G_FILE_TEST_IS_REGULAR: %TRUE if the file is a regular file (not a symlink or directory)
116 @G_FILE_TEST_IS_SYMLINK: %TRUE if the file is a symlink.
117 @G_FILE_TEST_IS_DIR: %TRUE if the file is a directory.
118 @G_FILE_TEST_IS_EXECUTABLE: %TRUE if the file is executable.
119 @G_FILE_TEST_EXISTS: %TRUE if the file exists. It may or may not be a regular file.
121 <!-- ##### FUNCTION g_file_error_from_errno ##### -->
130 <!-- ##### FUNCTION g_file_get_contents ##### -->
142 <!-- ##### FUNCTION g_file_test ##### -->
152 <!-- ##### FUNCTION g_mkstemp ##### -->
161 <!-- ##### FUNCTION g_file_open_tmp ##### -->
172 <!-- ##### FUNCTION g_file_read_link ##### -->
182 <!-- ##### STRUCT GDir ##### -->
184 An opaque structure representing an opened directory.
188 <!-- ##### FUNCTION g_dir_open ##### -->
199 <!-- ##### FUNCTION g_dir_read_name ##### -->
208 <!-- ##### FUNCTION g_dir_rewind ##### -->
216 <!-- ##### FUNCTION g_dir_close ##### -->