4 >Finding Special Directories</TITLE
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
10 TITLE="GnomeVFS - Filesystem Abstraction library"
11 HREF="index.html"><LINK
13 TITLE="Basic File Operations"
14 HREF="file-operations.html"><LINK
16 TITLE="Directory Operations"
17 HREF="gnome-vfs-directory.html"><LINK
19 TITLE="Asynchronous File I/O"
20 HREF="gnome-vfs-asynchronous-operations.html"></HEAD
43 >GnomeVFS - Filesystem Abstraction library</FONT
52 HREF="gnome-vfs-directory.html"
57 ><<< Previous Page</B
90 HREF="file-operations.html"
106 HREF="gnome-vfs-asynchronous-operations.html"
111 >Next Page >>></B
120 NAME="GNOME-VFS-FINDING-SPECIAL-DIRECTORIES"
121 >Finding Special Directories</A
130 >Finding Special Directories -- how to locate special directories such as the trash and desktop</DIV
132 CLASS="REFSYNOPSISDIV"
150 HREF="gnome-vfs-types.html#GNOMEVFSRESULT"
153 HREF="gnome-vfs-finding-special-directories.html#GNOME-VFS-FIND-DIRECTORY"
154 >gnome_vfs_find_directory</A
155 > (GnomeVFSURI *near_uri,
157 HREF="gnome-vfs-types.html#GNOMEVFSFINDDIRECTORYKIND"
158 >GnomeVFSFindDirectoryKind</A
160 GnomeVFSURI **result,
162 HREF=../glib/glib-basic-types.html#GBOOLEAN
163 >gboolean</A> create_if_needed,
165 HREF=../glib/glib-basic-types.html#GBOOLEAN
166 >gboolean</A> find_if_needed,
168 HREF=../glib/glib-basic-types.html#GUINT
169 >guint</A> permissions);</PRE
198 NAME="GNOME-VFS-FIND-DIRECTORY"
200 >gnome_vfs_find_directory ()</H3
209 CLASS="PROGRAMLISTING"
211 HREF="gnome-vfs-types.html#GNOMEVFSRESULT"
213 > gnome_vfs_find_directory (GnomeVFSURI *near_uri,
215 HREF="gnome-vfs-types.html#GNOMEVFSFINDDIRECTORYKIND"
216 >GnomeVFSFindDirectoryKind</A
218 GnomeVFSURI **result,
220 HREF=../glib/glib-basic-types.html#GBOOLEAN
221 >gboolean</A> create_if_needed,
223 HREF=../glib/glib-basic-types.html#GBOOLEAN
224 >gboolean</A> find_if_needed,
226 HREF=../glib/glib-basic-types.html#GUINT
227 >guint</A> permissions);</PRE
232 >Used to return well known directories such as Trash, Desktop, etc. from different
235 >There is quite a complicated logic behind finding/creating a Trash directory
236 and you need to be aware of some implications:
237 Finding the Trash the first time when using the file method may be pretty
238 expensive. A cache file is used to store the location of that Trash file
245 > is specified without <TT
251 creating a Trash file when there already is one. Your app should start out
252 by doing a gnome_vfs_find_directory with the <TT
263 > flag to create Trash lazily when it is
264 needed for throwing away an item on a given disk.</P
268 CLASS="INFORMALTABLE"
297 > find a well known directory on the same volume as <TT
319 > kind of well known directory</TD
336 > newly created URI of the directory we found</TD
353 > If directory we are looking for does not exist, try to create it</TD
370 > If we don't know where trash is yet, look for it.</TD
387 > If creating, use these permissions</TD
402 > An integer representing the result of the operation</TD
414 CLEAR="all"><BR><TABLE
426 HREF="gnome-vfs-directory.html"
431 ><<< Previous Page</B
464 HREF="file-operations.html"
480 HREF="gnome-vfs-asynchronous-operations.html"
485 >Next Page >>></B
498 >Directory Operations</B
508 >Asynchronous File I/O</B