1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>gnome-vfs-utils</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
7
<link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library">
8
<link rel="up" href="data-types.html" title="Basic Data Types">
9
<link rel="prev" href="gnome-vfs-2.0-gnome-vfs-uri.html" title="GnomeVFSURI">
10
<link rel="next" href="gnome-vfs-2.0-gnome-vfs-file-info.html" title="GnomeVFSFileInfo">
11
<meta name="generator" content="GTK-Doc V1.12 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="about.html" title="Introduction to GnomeVFS">
14
<link rel="chapter" href="data-types.html" title="Basic Data Types">
15
<link rel="chapter" href="gnome-vfs-basic-file-ops.html" title="File Operations">
16
<link rel="chapter" href="gnome-vfs-directory-ops.html" title="Directory-Specific Operations">
17
<link rel="chapter" href="gnome-vfs-file-and-dirs-ops.html" title="Advanced File/Directory Operations">
18
<link rel="chapter" href="gnome-vfs-file-async-ops.html" title="Asynchronous Operations">
19
<link rel="chapter" href="volumes.html" title="Volumes and Drives Handling">
20
<link rel="chapter" href="networking.html" title="Networking">
21
<link rel="chapter" href="mime-registry.html" title="MIME Registry">
22
<link rel="chapter" href="modules.html" title="Filesystem Modules">
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
27
<td><a accesskey="p" href="gnome-vfs-2.0-gnome-vfs-uri.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="u" href="data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
<th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th>
31
<td><a accesskey="n" href="gnome-vfs-2.0-gnome-vfs-file-info.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts">
34
<a href="#gnome-vfs-2.0-gnome-vfs-utils.synopsis" class="shortcut">Top</a>
36
<a href="#gnome-vfs-2.0-gnome-vfs-utils.description" class="shortcut">Description</a>
39
<div class="refentry" lang="en">
40
<a name="gnome-vfs-2.0-gnome-vfs-utils"></a><div class="titlepage"></div>
41
<div class="refnamediv"><table width="100%"><tr>
43
<h2><span class="refentrytitle"><a name="gnome-vfs-2.0-gnome-vfs-utils.top_of_page"></a>gnome-vfs-utils</span></h2>
44
<p>gnome-vfs-utils — various utilities functions to manipulate uris</p>
46
<td valign="top" align="right"></td>
48
<div class="refsynopsisdiv">
49
<a name="gnome-vfs-2.0-gnome-vfs-utils.synopsis"></a><h2>Synopsis</h2>
50
<pre class="synopsis">
51
enum <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#GnomeVFSMakeURIDirs" title="enum GnomeVFSMakeURIDirs">GnomeVFSMakeURIDirs</a>;
52
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-format-file-size-for-display" title="gnome_vfs_format_file_size_for_display ()">gnome_vfs_format_file_size_for_display</a>
53
(<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> size);
54
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-format-uri-for-display" title="gnome_vfs_format_uri_for_display ()">gnome_vfs_format_uri_for_display</a> (const char *uri);
55
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-url-show" title="gnome_vfs_url_show ()">gnome_vfs_url_show</a> (const char *url);
56
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-url-show-with-env" title="gnome_vfs_url_show_with_env ()">gnome_vfs_url_show_with_env</a> (const char *url,
58
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-escape-string" title="gnome_vfs_escape_string ()">gnome_vfs_escape_string</a> (const char *string);
59
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-escape-path-string" title="gnome_vfs_escape_path_string ()">gnome_vfs_escape_path_string</a> (const char *path);
60
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-escape-host-and-path-string" title="gnome_vfs_escape_host_and_path_string ()">gnome_vfs_escape_host_and_path_string</a>
62
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-escape-slashes" title="gnome_vfs_escape_slashes ()">gnome_vfs_escape_slashes</a> (const char *string);
63
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-escape-set" title="gnome_vfs_escape_set ()">gnome_vfs_escape_set</a> (const char *string,
64
const char *match_set);
65
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-unescape-string" title="gnome_vfs_unescape_string ()">gnome_vfs_unescape_string</a> (const char *escaped_string,
66
const char *illegal_characters);
67
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-canonical" title="gnome_vfs_make_uri_canonical ()">gnome_vfs_make_uri_canonical</a> (const char *uri);
68
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-canonical-strip-fragment" title="gnome_vfs_make_uri_canonical_strip_fragment ()">gnome_vfs_make_uri_canonical_strip_fragment</a>
70
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-path-name-canonical" title="gnome_vfs_make_path_name_canonical ()">gnome_vfs_make_path_name_canonical</a> (const char *path);
71
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-from-input" title="gnome_vfs_make_uri_from_input ()">gnome_vfs_make_uri_from_input</a> (const char *location);
72
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-from-input-with-dirs" title="gnome_vfs_make_uri_from_input_with_dirs ()">gnome_vfs_make_uri_from_input_with_dirs</a>
73
(const char *location,
74
<a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#GnomeVFSMakeURIDirs" title="enum GnomeVFSMakeURIDirs">GnomeVFSMakeURIDirs</a> dirs);
75
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-from-shell-arg" title="gnome_vfs_make_uri_from_shell_arg ()">gnome_vfs_make_uri_from_shell_arg</a> (const char *uri);
76
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-full-from-relative" title="gnome_vfs_make_uri_full_from_relative ()">gnome_vfs_make_uri_full_from_relative</a>
77
(const char *base_uri,
78
const char *relative_uri);
79
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-expand-initial-tilde" title="gnome_vfs_expand_initial_tilde ()">gnome_vfs_expand_initial_tilde</a> (const char *path);
80
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-unescape-string-for-display" title="gnome_vfs_unescape_string_for_display ()">gnome_vfs_unescape_string_for_display</a>
81
(const char *escaped);
82
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-get-local-path-from-uri" title="gnome_vfs_get_local_path_from_uri ()">gnome_vfs_get_local_path_from_uri</a> (const char *uri);
83
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-get-uri-from-local-path" title="gnome_vfs_get_uri_from_local_path ()">gnome_vfs_get_uri_from_local_path</a> (const char *local_full_path);
84
gboolean <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-is-executable-command-string" title="gnome_vfs_is_executable_command_string ()">gnome_vfs_is_executable_command_string</a>
85
(const char *command_string);
86
void <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-list-deep-free" title="gnome_vfs_list_deep_free ()">gnome_vfs_list_deep_free</a> (GList *list);
87
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-get-volume-free-space" title="gnome_vfs_get_volume_free_space ()">gnome_vfs_get_volume_free_space</a> (const <a class="link" href="gnome-vfs-2.0-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *vfs_uri,
88
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *size);
89
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-icon-path-from-filename" title="gnome_vfs_icon_path_from_filename ()">gnome_vfs_icon_path_from_filename</a> (const char *filename);
90
gboolean <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-is-primary-thread" title="gnome_vfs_is_primary_thread ()">gnome_vfs_is_primary_thread</a> (void);
91
char * <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-get-uri-scheme" title="gnome_vfs_get_uri_scheme ()">gnome_vfs_get_uri_scheme</a> (const char *uri);
92
gboolean <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-uris-match" title="gnome_vfs_uris_match ()">gnome_vfs_uris_match</a> (const char *uri_1,
94
#define <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#GNOME-VFS-ASSERT-PRIMARY-THREAD:CAPS" title="GNOME_VFS_ASSERT_PRIMARY_THREAD">GNOME_VFS_ASSERT_PRIMARY_THREAD</a>
95
#define <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#GNOME-VFS-ASSERT-SECONDARY-THREAD:CAPS" title="GNOME_VFS_ASSERT_SECONDARY_THREAD">GNOME_VFS_ASSERT_SECONDARY_THREAD</a>
96
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-open-fd" title="gnome_vfs_open_fd ()">gnome_vfs_open_fd</a> (GnomeVFSHandle **handle,
98
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-read-entire-file" title="gnome_vfs_read_entire_file ()">gnome_vfs_read_entire_file</a> (const char *uri,
100
char **file_contents);
103
<div class="refsect1" lang="en">
104
<a name="gnome-vfs-2.0-gnome-vfs-utils.description"></a><h2>Description</h2>
108
<div class="refsect1" lang="en">
109
<a name="gnome-vfs-2.0-gnome-vfs-utils.details"></a><h2>Details</h2>
110
<div class="refsect2" lang="en">
111
<a name="GnomeVFSMakeURIDirs"></a><h3>enum GnomeVFSMakeURIDirs</h3>
112
<pre class="programlisting">typedef enum {
113
GNOME_VFS_MAKE_URI_DIR_NONE = 0,
114
GNOME_VFS_MAKE_URI_DIR_HOMEDIR = 1 << 0,
115
GNOME_VFS_MAKE_URI_DIR_CURRENT = 1 << 1
116
} GnomeVFSMakeURIDirs;
119
Flags that can be passed to <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-from-input-with-dirs" title="gnome_vfs_make_uri_from_input_with_dirs ()"><code class="function">gnome_vfs_make_uri_from_input_with_dirs()</code></a>.
120
If the given input might be a relative path it checks for existence of the file
121
in the directory specified by this flag.
122
If both flags are passed the current directory is checked first.</p>
125
<div class="variablelist"><table border="0">
126
<col align="left" valign="top">
129
<td><p><a name="GNOME-VFS-MAKE-URI-DIR-NONE:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MAKE_URI_DIR_NONE</code></span></p></td>
130
<td> Don't check any directory
134
<td><p><a name="GNOME-VFS-MAKE-URI-DIR-HOMEDIR:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MAKE_URI_DIR_HOMEDIR</code></span></p></td>
135
<td> Check the home directory
139
<td><p><a name="GNOME-VFS-MAKE-URI-DIR-CURRENT:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MAKE_URI_DIR_CURRENT</code></span></p></td>
140
<td> Check the current direcotry
147
<div class="refsect2" lang="en">
148
<a name="gnome-vfs-format-file-size-for-display"></a><h3>gnome_vfs_format_file_size_for_display ()</h3>
149
<pre class="programlisting">char * gnome_vfs_format_file_size_for_display
150
(<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> size);</pre>
152
Formats the file <em class="parameter"><code>size</code></em> passed so that it is easy for
153
the user to read. Gives the size in bytes, kilobytes, megabytes or
154
gigabytes, choosing whatever is appropriate.</p>
157
<div class="variablelist"><table border="0">
158
<col align="left" valign="top">
161
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
162
<td> a <a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize"><span class="type">GnomeVFSFileSize</span></a> (a <span class="type">guint64</span> value).
166
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
167
<td> a newly allocated string with the size ready to be shown.
174
<div class="refsect2" lang="en">
175
<a name="gnome-vfs-format-uri-for-display"></a><h3>gnome_vfs_format_uri_for_display ()</h3>
176
<pre class="programlisting">char * gnome_vfs_format_uri_for_display (const char *uri);</pre>
178
Filter, modify, unescape and change <em class="parameter"><code>uri</code></em> to make it appropriate
179
for display to users. The conversion is done such that the roundtrip
180
to UTF-8 is reversible.
184
file: uri without fragments should appear as local paths.
185
file: uri with fragments should appear as file:uri.
186
All other uri appear as expected.</p>
189
<div class="variablelist"><table border="0">
190
<col align="left" valign="top">
193
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
194
<td> uri to be displayed.
198
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
199
<td> a newly allocated string which represents <em class="parameter"><code>uri</code></em> and can be displayed.
205
<p class="since">Since 2.2</p>
208
<div class="refsect2" lang="en">
209
<a name="gnome-vfs-url-show"></a><h3>gnome_vfs_url_show ()</h3>
210
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_url_show (const char *url);</pre>
212
Launches the default application or component associated with the given <em class="parameter"><code>url</code></em>.</p>
215
<div class="variablelist"><table border="0">
216
<col align="left" valign="top">
219
<td><p><span class="term"><em class="parameter"><code>url</code></em> :</span></p></td>
220
<td> url to be shown.
224
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
225
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-OK:CAPS"><code class="literal">GNOME_VFS_OK</code></a> if the default action was launched,
226
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-ERROR-BAD-PARAMETERS:CAPS"><code class="literal">GNOME_VFS_ERROR_BAD_PARAMETERS</code></a> for an invalid or non-existant <em class="parameter"><code>url</code></em>,
227
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-ERROR-NO-DEFAULT:CAPS"><code class="literal">GNOME_VFS_ERROR_NO_DEFAULT</code></a> if no default action is associated with the <em class="parameter"><code>url</code></em>.
228
Also error codes from <a class="link" href="gnome-vfs-2.0-gnome-vfs-mime-database-deprecated.html#gnome-vfs-mime-action-launch" title="gnome_vfs_mime_action_launch ()"><code class="function">gnome_vfs_mime_action_launch()</code></a>
229
or <a class="link" href="gnome-vfs-2.0-gnome-vfs-mime-database-deprecated.html#gnome-vfs-mime-action-launch-with-env" title="gnome_vfs_mime_action_launch_with_env ()"><code class="function">gnome_vfs_mime_action_launch_with_env()</code></a>.
235
<p class="since">Since 2.4</p>
238
<div class="refsect2" lang="en">
239
<a name="gnome-vfs-url-show-with-env"></a><h3>gnome_vfs_url_show_with_env ()</h3>
240
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_url_show_with_env (const char *url,
243
Like <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-url-show" title="gnome_vfs_url_show ()"><code class="function">gnome_vfs_url_show()</code></a> except that the default action will be launched
244
with the given environment.</p>
247
<div class="variablelist"><table border="0">
248
<col align="left" valign="top">
251
<td><p><span class="term"><em class="parameter"><code>url</code></em> :</span></p></td>
252
<td> url to be shown.
256
<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td>
257
<td> environment data.
261
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
262
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-OK:CAPS"><code class="literal">GNOME_VFS_OK</code></a> if the default action was launched.
263
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-ERROR-BAD-PARAMETERS:CAPS"><code class="literal">GNOME_VFS_ERROR_BAD_PARAMETERS</code></a> for an invalid or non-existant <em class="parameter"><code>url</code></em>,
264
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-ERROR-NO-DEFAULT:CAPS"><code class="literal">GNOME_VFS_ERROR_NO_DEFAULT</code></a> if no default action is associated with the <em class="parameter"><code>url</code></em>.
265
Also error codes from <a class="link" href="gnome-vfs-2.0-gnome-vfs-mime-database.html#gnome-vfs-mime-application-launch-with-env" title="gnome_vfs_mime_application_launch_with_env ()"><code class="function">gnome_vfs_mime_application_launch_with_env()</code></a>
266
or <a class="link" href="gnome-vfs-2.0-gnome-vfs-mime-database-deprecated.html#gnome-vfs-mime-action-launch-with-env" title="gnome_vfs_mime_action_launch_with_env ()"><code class="function">gnome_vfs_mime_action_launch_with_env()</code></a>.
272
<p class="since">Since 2.4</p>
275
<div class="refsect2" lang="en">
276
<a name="gnome-vfs-escape-string"></a><h3>gnome_vfs_escape_string ()</h3>
277
<pre class="programlisting">char * gnome_vfs_escape_string (const char *string);</pre>
279
Escapes <em class="parameter"><code>string</code></em>, replacing any and all special characters
280
with equivalent escape sequences.</p>
283
<div class="variablelist"><table border="0">
284
<col align="left" valign="top">
287
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
288
<td> string to be escaped.
292
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
293
<td> a newly allocated string equivalent to <em class="parameter"><code>string</code></em>
294
but with all special characters escaped.
301
<div class="refsect2" lang="en">
302
<a name="gnome-vfs-escape-path-string"></a><h3>gnome_vfs_escape_path_string ()</h3>
303
<pre class="programlisting">char * gnome_vfs_escape_path_string (const char *path);</pre>
305
Escapes <em class="parameter"><code>path</code></em>, replacing only special characters that would not
306
be found in paths (so '/', '&', and '=' will not be escaped by
310
<div class="variablelist"><table border="0">
311
<col align="left" valign="top">
314
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
315
<td> string to be escaped.
319
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
320
<td> a newly allocated string equivalent to <em class="parameter"><code>path</code></em> but
321
with non-path characters escaped.
328
<div class="refsect2" lang="en">
329
<a name="gnome-vfs-escape-host-and-path-string"></a><h3>gnome_vfs_escape_host_and_path_string ()</h3>
330
<pre class="programlisting">char * gnome_vfs_escape_host_and_path_string
331
(const char *path);</pre>
333
Escapes <em class="parameter"><code>path</code></em>, replacing only special characters that would not
334
be found in paths or host name (so '/', '&', '=', ':' and '@'
335
will not be escaped by this function).</p>
338
<div class="variablelist"><table border="0">
339
<col align="left" valign="top">
342
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
343
<td> string to be escaped.
347
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
348
<td> a newly allocated string equivalent to <em class="parameter"><code>path</code></em> but
349
with non-path/host characters escaped.
356
<div class="refsect2" lang="en">
357
<a name="gnome-vfs-escape-slashes"></a><h3>gnome_vfs_escape_slashes ()</h3>
358
<pre class="programlisting">char * gnome_vfs_escape_slashes (const char *string);</pre>
360
Escapes only '/' and '%' characters in <em class="parameter"><code>string</code></em>, replacing
361
them with their escape sequence equivalents.</p>
364
<div class="variablelist"><table border="0">
365
<col align="left" valign="top">
368
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
369
<td> string to be escaped.
373
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
374
<td> a newly allocated string equivalent to <em class="parameter"><code>string</code></em>,
375
but with no unescaped '/' or '%' characters.
382
<div class="refsect2" lang="en">
383
<a name="gnome-vfs-escape-set"></a><h3>gnome_vfs_escape_set ()</h3>
384
<pre class="programlisting">char * gnome_vfs_escape_set (const char *string,
385
const char *match_set);</pre>
387
Escapes all characters in <em class="parameter"><code>string</code></em> which are listed in <em class="parameter"><code>match_set</code></em>.</p>
390
<div class="variablelist"><table border="0">
391
<col align="left" valign="top">
394
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
395
<td> string to be escaped.
399
<td><p><span class="term"><em class="parameter"><code>match_set</code></em> :</span></p></td>
400
<td> a string containing all characters to be escaped in <em class="parameter"><code>string</code></em>.
404
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
405
<td> a newly allocated string equivalent to <em class="parameter"><code>string</code></em> but
406
with characters in <em class="parameter"><code>match_string</code></em> escaped.
413
<div class="refsect2" lang="en">
414
<a name="gnome-vfs-unescape-string"></a><h3>gnome_vfs_unescape_string ()</h3>
415
<pre class="programlisting">char * gnome_vfs_unescape_string (const char *escaped_string,
416
const char *illegal_characters);</pre>
418
Decodes escaped characters (i.e. PERCENTxx sequences) in <em class="parameter"><code>escaped_string</code></em>.
419
Characters are encoded in PERCENTxy form, where xy is the ASCII hex code
420
for character 16x+y.</p>
423
<div class="variablelist"><table border="0">
424
<col align="left" valign="top">
427
<td><p><span class="term"><em class="parameter"><code>escaped_string</code></em> :</span></p></td>
428
<td> an escaped uri, path, or other string.
432
<td><p><span class="term"><em class="parameter"><code>illegal_characters</code></em> :</span></p></td>
433
<td> a string containing a sequence of characters
434
considered "illegal" to be escaped, '\0' is automatically in this list.
438
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
439
<td> a newly allocated string with the unescaped
440
equivalents, or <a href="/gnome/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>escaped_string</code></em> contained an escaped
441
encoding of one of the characters in <em class="parameter"><code>illegal_characters</code></em>.
448
<div class="refsect2" lang="en">
449
<a name="gnome-vfs-make-uri-canonical"></a><h3>gnome_vfs_make_uri_canonical ()</h3>
450
<pre class="programlisting">char * gnome_vfs_make_uri_canonical (const char *uri);</pre>
452
Standardizes the format of the <em class="parameter"><code>uri</code></em>, so that it can be used
453
later in other functions that expect a canonical uri.</p>
456
<div class="variablelist"><table border="0">
457
<col align="left" valign="top">
460
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
461
<td> an absolute or relative stringified uri. It might have scheme.
465
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
466
<td> a newly allocated string that contains the canonical
467
representation of <em class="parameter"><code>uri</code></em>.
473
<p class="since">Since 2.2</p>
476
<div class="refsect2" lang="en">
477
<a name="gnome-vfs-make-uri-canonical-strip-fragment"></a><h3>gnome_vfs_make_uri_canonical_strip_fragment ()</h3>
478
<pre class="programlisting">char * gnome_vfs_make_uri_canonical_strip_fragment
479
(const char *uri);</pre>
481
Returns a canonicalized uri. If <em class="parameter"><code>uri</code></em> contains a fragment (anything after a '#') strips off that and
482
then makes the <em class="parameter"><code>uri</code></em> canonical.</p>
485
<div class="variablelist"><table border="0">
486
<col align="left" valign="top">
489
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
490
<td> a <span class="type">GnomeVFSURI.</span>
494
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
495
<td> a newly allocated string containing a canonical <em class="parameter"><code>uri</code></em>.
501
<p class="since">Since 2.2</p>
504
<div class="refsect2" lang="en">
505
<a name="gnome-vfs-make-path-name-canonical"></a><h3>gnome_vfs_make_path_name_canonical ()</h3>
506
<pre class="programlisting">char * gnome_vfs_make_path_name_canonical (const char *path);</pre>
508
Calls <code class="function">_gnome_vfs_canonicalize_pathname()</code>, allocating storage for the
509
result and providing for a cleaner memory management.</p>
512
<div class="variablelist"><table border="0">
513
<col align="left" valign="top">
516
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
517
<td> a file path, relative or absolute.
521
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
522
<td> a canonical version of <em class="parameter"><code>path</code></em>.
529
<div class="refsect2" lang="en">
530
<a name="gnome-vfs-make-uri-from-input"></a><h3>gnome_vfs_make_uri_from_input ()</h3>
531
<pre class="programlisting">char * gnome_vfs_make_uri_from_input (const char *location);</pre>
533
Takes a user input path/uri and makes a valid uri out of it.
536
This function is the reverse of <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-format-uri-for-display" title="gnome_vfs_format_uri_for_display ()"><code class="function">gnome_vfs_format_uri_for_display()</code></a>
537
but it also handles the fact that the user could have typed
538
arbitrary UTF-8 in the entry showing the string.</p>
541
<div class="variablelist"><table border="0">
542
<col align="left" valign="top">
545
<td><p><span class="term"><em class="parameter"><code>location</code></em> :</span></p></td>
546
<td> a possibly mangled "uri", in UTF-8.
550
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
551
<td> a newly allocated uri.
557
<p class="since">Since 2.2</p>
560
<div class="refsect2" lang="en">
561
<a name="gnome-vfs-make-uri-from-input-with-dirs"></a><h3>gnome_vfs_make_uri_from_input_with_dirs ()</h3>
562
<pre class="programlisting">char * gnome_vfs_make_uri_from_input_with_dirs
563
(const char *location,
564
<a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#GnomeVFSMakeURIDirs" title="enum GnomeVFSMakeURIDirs">GnomeVFSMakeURIDirs</a> dirs);</pre>
566
Determines a fully qualified uri from a relative or absolute input path.
567
Basically calls <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-from-input" title="gnome_vfs_make_uri_from_input ()"><code class="function">gnome_vfs_make_uri_from_input()</code></a> except it specifically
568
tries to support paths relative to the specified directories (can be homedir
569
and/or current directory). See <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#GnomeVFSMakeURIDirs" title="enum GnomeVFSMakeURIDirs"><span class="type">GnomeVFSMakeURIDirs</span></a> for more information.</p>
572
<div class="variablelist"><table border="0">
573
<col align="left" valign="top">
576
<td><p><span class="term"><em class="parameter"><code>location</code></em> :</span></p></td>
577
<td> a relative or absolute path.
581
<td><p><span class="term"><em class="parameter"><code>dirs</code></em> :</span></p></td>
582
<td> directory to use as a base directory if <em class="parameter"><code>location</code></em> is a relative path.
586
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
587
<td> a newly allocated string containing the fully qualified uri.
593
<p class="since">Since 2.4</p>
596
<div class="refsect2" lang="en">
597
<a name="gnome-vfs-make-uri-from-shell-arg"></a><h3>gnome_vfs_make_uri_from_shell_arg ()</h3>
598
<pre class="programlisting">char * gnome_vfs_make_uri_from_shell_arg (const char *uri);</pre>
600
Similar to <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-make-uri-from-input" title="gnome_vfs_make_uri_from_input ()"><code class="function">gnome_vfs_make_uri_from_input()</code></a>, except that:
603
1) guesses relative paths instead of http domains.
604
2) doesn't bother stripping leading/trailing white space.
605
3) doesn't bother with ~ expansion--that's done by the shell.</p>
608
<div class="variablelist"><table border="0">
609
<col align="left" valign="top">
612
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
613
<td> path to make the uri from.
617
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
618
<td> a newly allocated string representing <em class="parameter"><code>uri</code></em>.
624
<p class="since">Since 2.2</p>
627
<div class="refsect2" lang="en">
628
<a name="gnome-vfs-make-uri-full-from-relative"></a><h3>gnome_vfs_make_uri_full_from_relative ()</h3>
629
<pre class="programlisting">char * gnome_vfs_make_uri_full_from_relative
630
(const char *base_uri,
631
const char *relative_uri);</pre>
632
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
633
<h3 class="title">Warning</h3>
634
<p><code class="literal">gnome_vfs_make_uri_full_from_relative</code> is deprecated and should not be used in newly-written code. This function is deprecated, please use
635
<a class="link" href="gnome-vfs-2.0-gnome-vfs-uri.html#gnome-vfs-uri-make-full-from-relative" title="gnome_vfs_uri_make_full_from_relative ()"><code class="function">gnome_vfs_uri_make_full_from_relative()</code></a> from gnome-vfs-uri.h .</p>
638
Returns a string representing the full uri given a full <em class="parameter"><code>base_uri</code></em> and a
639
secondary uri which may be relative.</p>
642
<div class="variablelist"><table border="0">
643
<col align="left" valign="top">
646
<td><p><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></p></td>
647
<td> path to use as the base for the full uri.
651
<td><p><span class="term"><em class="parameter"><code>relative_uri</code></em> :</span></p></td>
652
<td> full or relative path to be appended to the <em class="parameter"><code>base_uri</code></em>.
656
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
657
<td> a newly allocated string containing the uri.
658
(<a href="/gnome/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for some bad errors).
664
<p class="since">Since 2.2</p>
667
<div class="refsect2" lang="en">
668
<a name="gnome-vfs-expand-initial-tilde"></a><h3>gnome_vfs_expand_initial_tilde ()</h3>
669
<pre class="programlisting">char * gnome_vfs_expand_initial_tilde (const char *path);</pre>
671
If <em class="parameter"><code>path</code></em> starts with a ~, representing the user's home
672
directory, expand it to the actual path location.</p>
675
<div class="variablelist"><table border="0">
676
<col align="left" valign="top">
679
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
680
<td> a local file path which may start with a '~'.
684
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
685
<td> a newly allocated string with the initial
686
tilde (if there was one) converted to an actual path.
693
<div class="refsect2" lang="en">
694
<a name="gnome-vfs-unescape-string-for-display"></a><h3>gnome_vfs_unescape_string_for_display ()</h3>
695
<pre class="programlisting">char * gnome_vfs_unescape_string_for_display
696
(const char *escaped);</pre>
698
Similar to gnome_vfs_unescape_string, but it returns something
699
semi-intelligable to a user even upon receiving traumatic input
700
such as <code class="literal">00</code> or URIs in bad form.
703
See also: <a class="link" href="gnome-vfs-2.0-gnome-vfs-utils.html#gnome-vfs-unescape-string" title="gnome_vfs_unescape_string ()"><code class="function">gnome_vfs_unescape_string()</code></a>.
706
WARNING: You should never use this function on a whole URI! It
707
unescapes reserved characters, and can result in a mangled URI
708
that can not be re-entered. For example, it unescapes "#" "&" and "?",
709
which have special meanings in URI strings.</p>
712
<div class="variablelist"><table border="0">
713
<col align="left" valign="top">
716
<td><p><span class="term"><em class="parameter"><code>escaped</code></em> :</span></p></td>
717
<td> a string encoded with escaped sequences.
721
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
722
<td> a pointer to a g_malloc'd string with all characters
723
replacing their escaped hex values.
730
<div class="refsect2" lang="en">
731
<a name="gnome-vfs-get-local-path-from-uri"></a><h3>gnome_vfs_get_local_path_from_uri ()</h3>
732
<pre class="programlisting">char * gnome_vfs_get_local_path_from_uri (const char *uri);</pre>
734
Create a local path for a file:/// uri. Do not use with uris
735
of other methods.</p>
738
<div class="variablelist"><table border="0">
739
<col align="left" valign="top">
742
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
743
<td> uri to convert to a local path.
747
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
748
<td> a newly allocated string containing the local path.
749
<a href="/gnome/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned on error or if the uri isn't a file: uri
750
without a fragment identifier (or chained uri).
757
<div class="refsect2" lang="en">
758
<a name="gnome-vfs-get-uri-from-local-path"></a><h3>gnome_vfs_get_uri_from_local_path ()</h3>
759
<pre class="programlisting">char * gnome_vfs_get_uri_from_local_path (const char *local_full_path);</pre>
761
Returns a file:/// URI for the local path <em class="parameter"><code>local_full_path</code></em>,
762
such as a path provided by <code class="function">gtk_file_chooser_get_filename()</code>.
763
The resulting URI may be provided, for instance, to <a class="link" href="gnome-vfs-2.0-gnome-vfs-uri.html#gnome-vfs-uri-new" title="gnome_vfs_uri_new ()"><code class="function">gnome_vfs_uri_new()</code></a>.
766
On Windows <em class="parameter"><code>local_full_path</code></em> should be in the UTF-8 encoding, and can start with a drive
767
letter, but doesn't have to.</p>
770
<div class="variablelist"><table border="0">
771
<col align="left" valign="top">
774
<td><p><span class="term"><em class="parameter"><code>local_full_path</code></em> :</span></p></td>
775
<td> a full local filesystem path (i.e. not relative).
779
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
780
<td> a newly allocated string containing the uri corresponding
781
to <em class="parameter"><code>local_full_path</code></em> (<a href="/gnome/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for some bad errors).
788
<div class="refsect2" lang="en">
789
<a name="gnome-vfs-is-executable-command-string"></a><h3>gnome_vfs_is_executable_command_string ()</h3>
790
<pre class="programlisting">gboolean gnome_vfs_is_executable_command_string
791
(const char *command_string);</pre>
793
Checks if <em class="parameter"><code>command_string</code></em> starts with the full path of an executable file
794
or an executable in $PATH.</p>
797
<div class="variablelist"><table border="0">
798
<col align="left" valign="top">
801
<td><p><span class="term"><em class="parameter"><code>command_string</code></em> :</span></p></td>
802
<td> a string representing a command ie "xterm -bg white".
806
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
807
<td> <code class="literal">TRUE</code> if <em class="parameter"><code>command_string</code></em> started with an executable file, and is in $PATH,
808
<code class="literal">FALSE</code> otherwise.
815
<div class="refsect2" lang="en">
816
<a name="gnome-vfs-list-deep-free"></a><h3>gnome_vfs_list_deep_free ()</h3>
817
<pre class="programlisting">void gnome_vfs_list_deep_free (GList *list);</pre>
819
Free <em class="parameter"><code>list</code></em> and call <code class="function">g_free()</code> on all data members.</p>
822
<div class="variablelist"><table border="0">
823
<col align="left" valign="top">
825
<td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td>
826
<td> list to be freed.
832
<div class="refsect2" lang="en">
833
<a name="gnome-vfs-get-volume-free-space"></a><h3>gnome_vfs_get_volume_free_space ()</h3>
834
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_volume_free_space (const <a class="link" href="gnome-vfs-2.0-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *vfs_uri,
835
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *size);</pre>
837
Stores the amount of free space in bytes on <em class="parameter"><code>vfs</code></em>-uri's
838
volume in <em class="parameter"><code>size</code></em>.</p>
841
<div class="variablelist"><table border="0">
842
<col align="left" valign="top">
845
<td><p><span class="term"><em class="parameter"><code>vfs_uri</code></em> :</span></p></td>
846
<td> a <span class="type">GnomeVFSURI.</span>
850
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
851
<td> a <span class="type">GnomeVFSFileSize.</span>
855
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
856
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-OK:CAPS"><code class="literal">GNOME_VFS_OK</code></a> on success, otherwise an
857
<code class="literal">GNOME_VFS_ERROR_</code>* code.
864
<div class="refsect2" lang="en">
865
<a name="gnome-vfs-icon-path-from-filename"></a><h3>gnome_vfs_icon_path_from_filename ()</h3>
866
<pre class="programlisting">char * gnome_vfs_icon_path_from_filename (const char *filename);</pre>
869
<div class="variablelist"><table border="0">
870
<col align="left" valign="top">
873
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
874
<td> path to a file. Could be relative or absolute path.
878
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
879
<td> Returns the icon path for the <em class="parameter"><code>filename</code></em>. Example:
880
gnome_vfs_icon_path_from_filename ("nautilus/nautilus-desktop.png") will return a string
881
forming the full path of the file nautilus-desktop.png ie $PREFIX/share/pixmaps/nautilus/nautilus-desktop.png.
888
<div class="refsect2" lang="en">
889
<a name="gnome-vfs-is-primary-thread"></a><h3>gnome_vfs_is_primary_thread ()</h3>
890
<pre class="programlisting">gboolean gnome_vfs_is_primary_thread (void);</pre>
892
Check if the current thread is the thread with the main glib event loop.</p>
895
<div class="variablelist"><table border="0">
896
<col align="left" valign="top">
898
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
899
<td> <code class="literal">TRUE</code> if the current thread is the thread with the
900
main glib event loop.
906
<div class="refsect2" lang="en">
907
<a name="gnome-vfs-get-uri-scheme"></a><h3>gnome_vfs_get_uri_scheme ()</h3>
908
<pre class="programlisting">char * gnome_vfs_get_uri_scheme (const char *uri);</pre>
910
Retrieve the scheme used in <em class="parameter"><code>uri</code></em>.</p>
913
<div class="variablelist"><table border="0">
914
<col align="left" valign="top">
917
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
918
<td> a stringified uri.
922
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
923
<td> a newly allocated string containing the scheme, <a href="/gnome/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>
924
if <em class="parameter"><code>uri</code></em> doesn't contain a scheme.
930
<p class="since">Since 2.2</p>
933
<div class="refsect2" lang="en">
934
<a name="gnome-vfs-uris-match"></a><h3>gnome_vfs_uris_match ()</h3>
935
<pre class="programlisting">gboolean gnome_vfs_uris_match (const char *uri_1,
936
const char *uri_2);</pre>
938
Compare two uris.</p>
941
<div class="variablelist"><table border="0">
942
<col align="left" valign="top">
945
<td><p><span class="term"><em class="parameter"><code>uri_1</code></em> :</span></p></td>
946
<td> stringified uri to compare with <em class="parameter"><code>uri_2</code></em>.
950
<td><p><span class="term"><em class="parameter"><code>uri_2</code></em> :</span></p></td>
951
<td> stringified uri to compare with <em class="parameter"><code>uri_1</code></em>.
955
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
956
<td> <code class="literal">TRUE</code> if they are the same, <code class="literal">FALSE</code> otherwise.
962
<p class="since">Since 2.2</p>
965
<div class="refsect2" lang="en">
966
<a name="GNOME-VFS-ASSERT-PRIMARY-THREAD:CAPS"></a><h3>GNOME_VFS_ASSERT_PRIMARY_THREAD</h3>
967
<pre class="programlisting">#define GNOME_VFS_ASSERT_PRIMARY_THREAD g_assert (gnome_vfs_is_primary_thread())
970
Asserts that the current thread is the thread with
971
the main glib event loop</p>
976
<div class="refsect2" lang="en">
977
<a name="GNOME-VFS-ASSERT-SECONDARY-THREAD:CAPS"></a><h3>GNOME_VFS_ASSERT_SECONDARY_THREAD</h3>
978
<pre class="programlisting">#define GNOME_VFS_ASSERT_SECONDARY_THREAD g_assert (!gnome_vfs_is_primary_thread())
981
Asserts that the current thread is NOT the thread with
982
the main glib event loop</p>
987
<div class="refsect2" lang="en">
988
<a name="gnome-vfs-open-fd"></a><h3>gnome_vfs_open_fd ()</h3>
989
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_open_fd (GnomeVFSHandle **handle,
992
Converts an open unix file descript into a GnomeVFSHandle that
993
can be used with the normal GnomeVFS file operations. When the
994
handle is closed the file descriptor will also be closed.</p>
997
<div class="variablelist"><table border="0">
998
<col align="left" valign="top">
1001
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
1002
<td> A pointer to a pointer to a GnomeVFSHandle object
1006
<td><p><span class="term"><em class="parameter"><code>filedes</code></em> :</span></p></td>
1007
<td> a UNIX file descriptor
1011
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1012
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GNOME-VFS-OK:CAPS"><code class="literal">GNOME_VFS_OK</code></a> if the open was ok, a suitable error otherwise.
1021
<div class="refsect2" lang="en">
1022
<a name="gnome-vfs-read-entire-file"></a><h3>gnome_vfs_read_entire_file ()</h3>
1023
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_read_entire_file (const char *uri,
1025
char **file_contents);</pre>
1027
Reads an entire file into memory for convenience. Beware accidentally
1028
loading large files into memory with this function.
1031
Since version 2.10 the string stored in <em class="parameter"><code>file_contents</code></em> will be null-terminated,
1032
so for text files you can use result as a normal string.</p>
1035
<div class="variablelist"><table border="0">
1036
<col align="left" valign="top">
1039
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
1040
<td> uri of the file to read.
1044
<td><p><span class="term"><em class="parameter"><code>file_size</code></em> :</span></p></td>
1045
<td> after reading the file, contains the size of the file read.
1049
<td><p><span class="term"><em class="parameter"><code>file_contents</code></em> :</span></p></td>
1050
<td> contains the file_size bytes, the contents of the file at <em class="parameter"><code>uri</code></em>.
1054
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1055
<td> an integer representing the result of the operation.
1061
<p class="since">Since 2.2</p>
1065
<div class="footer">
1067
Generated by GTK-Doc V1.12</div>