ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / doc / html / gnome-vfs-gnome-vfs-directory-find-ops.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
2 Locating Standard Directories</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
3         .synopsis, .classsynopsis {
4             background: #eeeeee;
5             border: solid 1px #aaaaaa;
6             padding: 0.5em;
7         }
8         .programlisting {
9             background: #eeeeff;
10             border: solid 1px #aaaaff;
11             padding: 0.5em;
12         }
13         .variablelist {
14             padding: 4px;
15             margin-left: 3em;
16         }
17         .navigation {
18             background: #ffeeee;
19             border: solid 1px #ffaaaa;
20             margin-top: 0.5em;
21             margin-bottom: 0.5em;
22         }
23         .navigation a {
24             color: #770000;
25         }
26         .navigation a:visited {
27             color: #550000;
28         }
29         .navigation .title {
30             font-size: 200%;
31         }
32       </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="gnome-vfs-directory-operations.html" title="Directory Handling"><link rel="previous" href="gnome-vfs-gnome-vfs-directory-list-ops.html" title="
33 Listing Directory Contents"><link rel="next" href="gnome-vfs-file-operations.html" title="File Handling"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="gnome-vfs-gnome-vfs-directory-list-ops.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="gnome-vfs-directory-operations.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-file-operations.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-gnome-vfs-directory-find-ops"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">
34 Locating Standard Directories</span></h2><p>
35 Locating Standard Directories &#8212; 
36 Utilities for locating standard directories such as the desktop and trash</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
37
38
39
40 enum        <a href="gnome-vfs-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a>;
41 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-directory-find-ops.html#gnome-vfs-find-directory">gnome_vfs_find_directory</a>     (GnomeVFSURI *near_uri,
42                                              <a href="gnome-vfs-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a> kind,
43                                              GnomeVFSURI **result,
44                                              <a
45 href="../glib/glib-Basic-Types.html#gboolean"
46 >gboolean</a> create_if_needed,
47                                              <a
48 href="../glib/glib-Basic-Types.html#gboolean"
49 >gboolean</a> find_if_needed,
50                                              <a
51 href="../glib/glib-Basic-Types.html#guint"
52 >guint</a> permissions);
53 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
54
55 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="GnomeVFSFindDirectoryKind"></a>enum GnomeVFSFindDirectoryKind</h3><pre class="programlisting">typedef enum {
56         GNOME_VFS_DIRECTORY_KIND_DESKTOP = 1000,
57         GNOME_VFS_DIRECTORY_KIND_TRASH = 1001
58 } GnomeVFSFindDirectoryKind;
59 </pre><p>
60
61 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-find-directory"></a>gnome_vfs_find_directory ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_find_directory     (GnomeVFSURI *near_uri,
62                                              <a href="gnome-vfs-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a> kind,
63                                              GnomeVFSURI **result,
64                                              <a
65 href="../glib/glib-Basic-Types.html#gboolean"
66 >gboolean</a> create_if_needed,
67                                              <a
68 href="../glib/glib-Basic-Types.html#gboolean"
69 >gboolean</a> find_if_needed,
70                                              <a
71 href="../glib/glib-Basic-Types.html#guint"
72 >guint</a> permissions);</pre><p>
73 Used to return well known directories such as Trash, Desktop, etc. from different
74 file systems.
75 </p><p>
76 There is quite a complicated logic behind finding/creating a Trash directory
77 and you need to be aware of some implications:
78 Finding the Trash the first time when using the file method may be pretty 
79 expensive. A cache file is used to store the location of that Trash file
80 for next time.
81 If <i class="parameter"><tt>ceate_if_needed</tt></i> is specified without <i class="parameter"><tt>find_if_needed</tt></i>, you may end up
82 creating a Trash file when there already is one. Your app should start out
83 by doing a gnome_vfs_find_directory with the <i class="parameter"><tt>find_if_needed</tt></i> to avoid this
84 and then use the <i class="parameter"><tt>create_if_needed</tt></i> flag to create Trash lazily when it is
85 needed for throwing away an item on a given disk.</p><p>
86
87 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>near_uri</tt></i> :</span></td><td> find a well known directory on the same volume as <i class="parameter"><tt>near_uri</tt></i>
88 </td></tr><tr><td><span class="term"><i class="parameter"><tt>kind</tt></i> :</span></td><td> kind of well known directory
89 </td></tr><tr><td><span class="term"><i class="parameter"><tt>result</tt></i> :</span></td><td> newly created URI of the directory we found
90 </td></tr><tr><td><span class="term"><i class="parameter"><tt>create_if_needed</tt></i> :</span></td><td> If directory we are looking for does not exist, try to create it
91 </td></tr><tr><td><span class="term"><i class="parameter"><tt>find_if_needed</tt></i> :</span></td><td> If we don't know where trash is yet, look for it.
92 </td></tr><tr><td><span class="term"><i class="parameter"><tt>permissions</tt></i> :</span></td><td> If creating, use these permissions
93 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation
94 </td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="gnome-vfs-gnome-vfs-directory-list-ops.html"><b>&lt;&lt; 
95 Listing Directory Contents</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-file-operations.html"><b>File Handling &gt;&gt;</b></a></td></tr></table></body></html>