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>Introduction</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="pt01.html" title="Part I. GIO Overview">
9 <link rel="prev" href="pt01.html" title="Part I. GIO Overview">
10 <link rel="next" href="ch02.html" title="Compiling GIO applications">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16 <td><a accesskey="p" href="pt01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17 <td><a accesskey="u" href="pt01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19 <th width="100%" align="center">GIO Reference Manual</th>
20 <td><a accesskey="n" href="ch02.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <div class="titlepage"><div><div><h2 class="title">
24 <a name="id493883"></a>Introduction</h2></div></div></div>
26 GIO is striving to provide a modern, easy-to-use VFS API that sits
27 at the right level in the library stack. The goal is to overcome the
28 shortcomings of GnomeVFS and provide an API that is so good that
29 developers prefer it over raw POSIX calls. Among other things
30 that means using GObject. It also means not cloning the POSIX
31 API, but providing higher-level, document-centric interfaces.
34 The abstract file system model of GIO consists of a number of
35 interfaces and base classes for I/O and files:
37 <div class="variablelist"><table border="0">
38 <col align="left" valign="top">
41 <td><p><span class="term">GFile</span></p></td>
42 <td><p>reference to a file</p></td>
45 <td><p><span class="term">GFileInfo</span></p></td>
46 <td><p>information about a file or filesystem</p></td>
49 <td><p><span class="term">GFileEnumerator</span></p></td>
50 <td><p>list files in directories</p></td>
53 <td><p><span class="term">GDrive</span></p></td>
54 <td><p>represents a drive</p></td>
57 <td><p><span class="term">GVolume</span></p></td>
58 <td><p>represents a file system in an abstract way</p></td>
61 <td><p><span class="term">GMount</span></p></td>
62 <td><p>represents a mounted file system</p></td>
67 Then there is a number of stream classes, similar to the input and
68 output stream hierarchies that can be found in frameworks like Java:
70 <div class="variablelist"><table border="0">
71 <col align="left" valign="top">
74 <td><p><span class="term">GInputStream</span></p></td>
75 <td><p>read data</p></td>
78 <td><p><span class="term">GOutputStream</span></p></td>
79 <td><p>write data</p></td>
82 <td><p><span class="term">GIOStream</span></p></td>
83 <td><p>read and write data</p></td>
86 <td><p><span class="term">GSeekable</span></p></td>
87 <td><p>interface optionally implemented by streams to support seeking</p></td>
92 There are interfaces related to applications and the types
95 <div class="variablelist"><table border="0">
96 <col align="left" valign="top">
99 <td><p><span class="term">GAppInfo</span></p></td>
100 <td><p>information about an installed application</p></td>
103 <td><p><span class="term">GIcon</span></p></td>
104 <td><p>abstract type for file and application icons</p></td>
109 There is a framework for storing and retrieving application settings:
111 <div class="variablelist"><table border="0">
112 <col align="left" valign="top">
114 <td><p><span class="term">GSettings</span></p></td>
115 <td><p>stores and retrieves application settings</p></td>
119 There is support for network programming, including connectivity monitoring,
120 name resolution, lowlevel socket APIs and highlevel client and server
123 <div class="variablelist"><table border="0">
124 <col align="left" valign="top">
127 <td><p><span class="term">GSocket</span></p></td>
128 <td><p>lowlevel platform independent socket object</p></td>
131 <td><p><span class="term">GResolver</span></p></td>
132 <td><p>asynchronous and cancellable DNS resolver</p></td>
135 <td><p><span class="term">GSocketClient</span></p></td>
136 <td><p>high-level network client helper</p></td>
139 <td><p><span class="term">GSocketService</span></p></td>
140 <td><p>high-level network server helper</p></td>
143 <td><p><span class="term">GSocketConnection</span></p></td>
144 <td><p>network connection stream</p></td>
147 <td><p><span class="term">GNetworkMonitor</span></p></td>
148 <td><p>network connectivity monitoring</p></td>
153 There is support for connecting to D-Bus,
154 sending and receiving messages, owning and watching bus names,
155 and making objects available on the bus:
157 <div class="variablelist"><table border="0">
158 <col align="left" valign="top">
161 <td><p><span class="term">GDBusConnection</span></p></td>
162 <td><p>a D-Bus connection</p></td>
165 <td><p><span class="term">GDBusMethodInvocation</span></p></td>
166 <td><p>for handling remove calls</p></td>
169 <td><p><span class="term">GDBusServer</span></p></td>
170 <td><p>helper for accepting connections</p></td>
173 <td><p><span class="term">GDBusProxy</span></p></td>
174 <td><p>proxy to access D-Bus interfaces on a remote object</p></td>
179 Beyond these, GIO provides facilities for file monitoring,
180 asynchronous I/O and filename completion. In addition to the
181 interfaces, GIO provides implementations for the local case.
182 Implementations for various network file systems are provided
183 by the GVFS package as loadable modules.
186 Other design choices which consciously break with the GnomeVFS
187 design are to move backends out-of-process, which minimizes the
188 dependency bloat and makes the whole system more robust. The backends
189 are not included in GIO, but in the separate GVFS package. The GVFS
190 package also contains the GVFS daemon, which spawn further mount
191 daemons for each individual connection.
194 <a name="gvfs-overview"></a><p class="title"><b>Figure 1. GIO in the GTK+ library stack</b></p>
195 <div class="figure-contents"><div><img src="gvfs-overview.png" alt="GIO in the GTK+ library stack"></div></div>
197 <br class="figure-break"><p>
198 The GIO model of I/O is stateful: if an application establishes e.g.
199 a SFTP connection to a server, it becomes available to all applications
200 in the session; the user does not have to enter his password over
204 One of the big advantages of putting the VFS in the GLib layer
205 is that GTK+ can directly use it, e.g. in the filechooser.
210 Generated by GTK-Doc V1.18</div>