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-20-gnome-vfs-directory-find-ops.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>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">
2         .synopsis, .classsynopsis {
3             background: #eeeeee;
4             border: solid 1px #aaaaaa;
5             padding: 0.5em;
6         }
7         .programlisting {
8             background: #eeeeff;
9             border: solid 1px #aaaaff;
10             padding: 0.5em;
11         }
12         .variablelist {
13             padding: 4px;
14             margin-left: 3em;
15         }
16         .navigation {
17             background: #ffeeee;
18             border: solid 1px #ffaaaa;
19             margin-top: 0.5em;
20             margin-bottom: 0.5em;
21         }
22         .navigation a {
23             color: #770000;
24         }
25         .navigation a:visited {
26             color: #550000;
27         }
28         .navigation .title {
29             font-size: 200%;
30         }
31       </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-20-gnome-vfs-directory-list-ops.html" title="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-20-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-20-gnome-vfs-directory-find-ops"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Locating Standard Directories</span></h2><p>Locating Standard Directories &#8212; 
32 Utilities for locating standard directories such as the desktop and trash</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
33
34
35
36 enum        <a href="gnome-vfs-20-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a>;
37 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-directory-find-ops.html#gnome-vfs-find-directory">gnome_vfs_find_directory</a>     (GnomeVFSURI *near_uri,
38                                              <a href="gnome-vfs-20-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a> kind,
39                                              GnomeVFSURI **result,
40                                              <a
41 href="../glib/glib-Basic-Types.html#gboolean"
42 >gboolean</a> create_if_needed,
43                                              <a
44 href="../glib/glib-Basic-Types.html#gboolean"
45 >gboolean</a> find_if_needed,
46                                              <a
47 href="../glib/glib-Basic-Types.html#guint"
48 >guint</a> permissions);
49 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
50
51 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="GnomeVFSFindDirectoryKind"></a>enum GnomeVFSFindDirectoryKind</h3><a class="indexterm" name="id2891281"></a><pre class="programlisting">typedef enum {
52         GNOME_VFS_DIRECTORY_KIND_DESKTOP = 1000,
53         GNOME_VFS_DIRECTORY_KIND_TRASH = 1001
54 } GnomeVFSFindDirectoryKind;
55 </pre><p>
56
57 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-find-directory"></a>gnome_vfs_find_directory ()</h3><a class="indexterm" name="id2891315"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_find_directory     (GnomeVFSURI *near_uri,
58                                              <a href="gnome-vfs-20-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a> kind,
59                                              GnomeVFSURI **result,
60                                              <a
61 href="../glib/glib-Basic-Types.html#gboolean"
62 >gboolean</a> create_if_needed,
63                                              <a
64 href="../glib/glib-Basic-Types.html#gboolean"
65 >gboolean</a> find_if_needed,
66                                              <a
67 href="../glib/glib-Basic-Types.html#guint"
68 >guint</a> permissions);</pre><p>
69 Used to return well known directories such as Trash, Desktop, etc. from different
70 file systems.
71 </p><p>
72 There is quite a complicated logic behind finding/creating a Trash directory
73 and you need to be aware of some implications:
74 Finding the Trash the first time when using the file method may be pretty 
75 expensive. A cache file is used to store the location of that Trash file
76 for next time.
77 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
78 creating a Trash file when there already is one. Your app should start out
79 by doing a gnome_vfs_find_directory with the <i class="parameter"><tt>find_if_needed</tt></i> to avoid this
80 and then use the <i class="parameter"><tt>create_if_needed</tt></i> flag to create Trash lazily when it is
81 needed for throwing away an item on a given disk.</p><p>
82
83 </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>
84 </td></tr><tr><td><span class="term"><i class="parameter"><tt>kind</tt></i> :</span></td><td> kind of well known directory
85 </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
86 </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
87 </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.
88 </td></tr><tr><td><span class="term"><i class="parameter"><tt>permissions</tt></i> :</span></td><td> If creating, use these permissions
89 </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
90 </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-20-gnome-vfs-directory-list-ops.html"><b>&lt;&lt; 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>