Revert mistaken change: it is UNIX, not Unix.
[platform/upstream/glib.git] / docs / reference / glib / tmpl / fileutils.sgml
1 <!-- ##### SECTION Title ##### -->
2 File Utilities
3
4 <!-- ##### SECTION Short_Description ##### -->
5 various file-related functions.
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9
10 </para>
11
12 <!-- ##### SECTION See_Also ##### -->
13 <para>
14
15 </para>
16
17 <!-- ##### ENUM GFileError ##### -->
18 <para>
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
25 of that manual.
26 </para>
27
28 <para>
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.
33 </para>
34
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
54      mapping.
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
60   memory.)
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
63   links.
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
70      limit.
71 @G_FILE_ERROR_NFILE: There are too many distinct file openings in the
72      entire system.
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
78      library function.
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
84      blocked `SIGPIPE'.
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
92     is returning errors.
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
99   code applies.
100
101 <!-- ##### MACRO G_FILE_ERROR ##### -->
102 <para>
103 Error domain for file operations. Errors in this domain will
104 be from the #GFileError enumeration. See #GError for information on 
105 error domains.
106 </para>
107
108
109
110 <!-- ##### ENUM GFileTest ##### -->
111 <para>
112 A test to perform an a file using g_file_test().
113 </para>
114
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.
120
121 <!-- ##### FUNCTION g_file_error_from_errno ##### -->
122 <para>
123
124 </para>
125
126 @err_no: 
127 @Returns: 
128
129
130 <!-- ##### FUNCTION g_file_get_contents ##### -->
131 <para>
132
133 </para>
134
135 @filename: 
136 @contents: 
137 @length: 
138 @error: 
139 @Returns: 
140
141
142 <!-- ##### FUNCTION g_file_test ##### -->
143 <para>
144
145 </para>
146
147 @filename: 
148 @test: 
149 @Returns: 
150
151
152 <!-- ##### FUNCTION g_mkstemp ##### -->
153 <para>
154
155 </para>
156
157 @tmpl: 
158 @Returns: 
159
160
161 <!-- ##### FUNCTION g_file_open_tmp ##### -->
162 <para>
163
164 </para>
165
166 @tmpl: 
167 @name_used: 
168 @error: 
169 @Returns: 
170
171
172 <!-- ##### STRUCT GDir ##### -->
173 <para>
174 An opaque structure representing an opened directory.
175 </para>
176
177
178 <!-- ##### FUNCTION g_dir_open ##### -->
179 <para>
180
181 </para>
182
183 @path: 
184 @flags: 
185 @error: 
186 @Returns: 
187
188
189 <!-- ##### FUNCTION g_dir_read_name ##### -->
190 <para>
191
192 </para>
193
194 @dir: 
195 @Returns: 
196
197
198 <!-- ##### FUNCTION g_dir_rewind ##### -->
199 <para>
200
201 </para>
202
203 @dir: 
204
205
206 <!-- ##### FUNCTION g_dir_close ##### -->
207 <para>
208
209 </para>
210
211 @dir: 
212
213