Fix a typo. (#151109, Stepan Kasal)
[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_NOSYS: Function not implemented; this indicates that the
97     system is missing some functionality.  
98 @G_FILE_ERROR_FAILED: Does not correspond to a UNIX error code; this
99   is the standard "failed for unspecified reason" error code present in 
100   all #GError error code enumerations. Returned if no specific
101   code applies.
102
103 <!-- ##### MACRO G_FILE_ERROR ##### -->
104 <para>
105 Error domain for file operations. Errors in this domain will
106 be from the #GFileError enumeration. See #GError for information on 
107 error domains.
108 </para>
109
110
111
112 <!-- ##### ENUM GFileTest ##### -->
113 <para>
114 A test to perform on a file using g_file_test().
115 </para>
116
117 @G_FILE_TEST_IS_REGULAR: %TRUE if the file is a regular file (not a symlink or directory)
118 @G_FILE_TEST_IS_SYMLINK: %TRUE if the file is a symlink.
119 @G_FILE_TEST_IS_DIR: %TRUE if the file is a directory.
120 @G_FILE_TEST_IS_EXECUTABLE: %TRUE if the file is executable.
121 @G_FILE_TEST_EXISTS: %TRUE if the file exists. It may or may not be a regular file.
122
123 <!-- ##### FUNCTION g_file_error_from_errno ##### -->
124 <para>
125
126 </para>
127
128 @err_no: 
129 @Returns: 
130
131
132 <!-- ##### FUNCTION g_file_get_contents ##### -->
133 <para>
134
135 </para>
136
137 @filename: 
138 @contents: 
139 @length: 
140 @error: 
141 @Returns: 
142
143
144 <!-- ##### FUNCTION g_file_test ##### -->
145 <para>
146
147 </para>
148
149 @filename: 
150 @test: 
151 @Returns: 
152
153
154 <!-- ##### FUNCTION g_mkstemp ##### -->
155 <para>
156
157 </para>
158
159 @tmpl: 
160 @Returns: 
161
162
163 <!-- ##### FUNCTION g_file_open_tmp ##### -->
164 <para>
165
166 </para>
167
168 @tmpl: 
169 @name_used: 
170 @error: 
171 @Returns: 
172
173
174 <!-- ##### FUNCTION g_file_read_link ##### -->
175 <para>
176
177 </para>
178
179 @filename: 
180 @error: 
181 @Returns: 
182
183
184 <!-- ##### STRUCT GDir ##### -->
185 <para>
186 An opaque structure representing an opened directory.
187 </para>
188
189
190 <!-- ##### FUNCTION g_dir_open ##### -->
191 <para>
192
193 </para>
194
195 @path: 
196 @flags: 
197 @error: 
198 @Returns: 
199
200
201 <!-- ##### FUNCTION g_dir_read_name ##### -->
202 <para>
203
204 </para>
205
206 @dir: 
207 @Returns: 
208
209
210 <!-- ##### FUNCTION g_dir_rewind ##### -->
211 <para>
212
213 </para>
214
215 @dir: 
216
217
218 <!-- ##### FUNCTION g_dir_close ##### -->
219 <para>
220
221 </para>
222
223 @dir: 
224
225