File: fuse_api.html

package info (click to toggle)
python-llfuse 0.40-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,400 kB
  • ctags: 5,474
  • sloc: python: 1,240; ansic: 139; makefile: 65
file content (230 lines) | stat: -rw-r--r-- 14,208 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>FUSE API Functions &mdash; LLFUSE 0.40 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.40',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="LLFUSE 0.40 documentation" href="index.html" />
    <link rel="next" title="Data Structures" href="data.html" />
    <link rel="prev" title="Getting started" href="getting_started.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="data.html" title="Data Structures"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="getting_started.html" title="Getting started"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">LLFUSE 0.40 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="fuse-api-functions">
<h1>FUSE API Functions<a class="headerlink" href="#fuse-api-functions" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="llfuse.init">
<tt class="descclassname">llfuse.</tt><tt class="descname">init</tt><big>(</big><em>ops</em>, <em>mountpoint</em>, <em>list args</em><big>)</big><a class="headerlink" href="#llfuse.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize and mount FUSE file system</p>
<p><em>ops</em> has to be an instance of the <a class="reference internal" href="operations.html#llfuse.Operations" title="llfuse.Operations"><tt class="xref py py-obj docutils literal"><span class="pre">Operations</span></tt></a> class (or another
class defining the same methods).</p>
<p><em>args</em> has to be a list of strings. Valid options are listed under <tt class="docutils literal"><span class="pre">struct</span>
<span class="pre">fuse_opt</span> <span class="pre">fuse_mount_opts[]</span></tt>
(<a class="reference external" href="http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;f=lib/mount.c;hb=HEAD#l82">mount.c:82</a>)
and <tt class="docutils literal"><span class="pre">struct</span> <span class="pre">fuse_opt</span> <span class="pre">fuse_ll_opts[]</span></tt>
(<a class="reference external" href="http://fuse.git.sourceforge.net/git/gitweb.cgi?p=fuse/fuse;f=lib/fuse_lowlevel.c;hb=HEAD#l2532">fuse_lowlevel_c:2209</a>).</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.main">
<tt class="descclassname">llfuse.</tt><tt class="descname">main</tt><big>(</big><em>single=False</em><big>)</big><a class="headerlink" href="#llfuse.main" title="Permalink to this definition">¶</a></dt>
<dd><p>Run FUSE main loop</p>
<p>If <em>single</em> is True, all requests will be handled sequentially by
the thread that has called <a class="reference internal" href="#llfuse.main" title="llfuse.main"><tt class="xref py py-obj docutils literal"><span class="pre">main</span></tt></a>. If <em>single</em> is False, multiple
worker threads will be started and work on requests concurrently.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.close">
<tt class="descclassname">llfuse.</tt><tt class="descname">close</tt><big>(</big><em>unmount=True</em><big>)</big><a class="headerlink" href="#llfuse.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Unmount file system and clean up</p>
<p>If <em>unmount</em> is False, only clean up operations are peformed, but
the file system is not unmounted. As long as the file system
process is still running, all requests will hang. Once the process
has terminated, these (and all future) requests fail with ESHUTDOWN.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.setxattr">
<tt class="descclassname">llfuse.</tt><tt class="descname">setxattr</tt><big>(</big><em>path</em>, <em>name</em>, <em>value</em>, <em>namespace=u'user'</em><big>)</big><a class="headerlink" href="#llfuse.setxattr" title="Permalink to this definition">¶</a></dt>
<dd><p>Set extended attribute</p>
<p><em>path</em> and <em>name</em> have to be of type <a class="reference external" href="http://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>. In Python 3.x, they may
contain surrogates. <em>value</em> has to be of type <a class="reference external" href="http://docs.python.org/3/library/functions.html#bytes" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">bytes</span></tt></a>.</p>
<p>Under FreeBSD, the <em>namespace</em> parameter may be set to <em>system</em> or <em>user</em> to
select the namespace for the extended attribute. For other platforms, this
parameter is ignored.</p>
<p>In contrast the <a class="reference external" href="http://docs.python.org/3/library/os.html#os.setxattr" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">os.setxattr</span></tt></a> function from the standard library,
the method provided by llfuse is also available for non-Linux
systems.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.getxattr">
<tt class="descclassname">llfuse.</tt><tt class="descname">getxattr</tt><big>(</big><em>path</em>, <em>name</em>, <em>size_guess=128</em>, <em>namespace=u'user'</em><big>)</big><a class="headerlink" href="#llfuse.getxattr" title="Permalink to this definition">¶</a></dt>
<dd><p>Get extended attribute</p>
<p><em>path</em> and <em>name</em> have to be of type <a class="reference external" href="http://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>. In Python 3.x, they may
contain surrogates. Returns a value of type <a class="reference external" href="http://docs.python.org/3/library/functions.html#bytes" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">bytes</span></tt></a>.</p>
<p>If the caller knows the approximate size of the attribute value,
it should be supplied in <em>size_guess</em>. If the guess turns out
to be wrong, the system call has to be carried out three times
(the first call will fail, the second determines the size and
the third finally gets the value).</p>
<p>Under FreeBSD, the <em>namespace</em> parameter may be set to <em>system</em> or <em>user</em> to
select the namespace for the extended attribute. For other platforms, this
parameter is ignored.</p>
<p>In contrast the <a class="reference external" href="http://docs.python.org/3/library/os.html#os.setxattr" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">os.setxattr</span></tt></a> function from the standard library,
the method provided by llfuse is also available for non-Linux
systems.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.listdir">
<tt class="descclassname">llfuse.</tt><tt class="descname">listdir</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#llfuse.listdir" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference external" href="http://docs.python.org/3/library/os.html#os.listdir" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">os.listdir</span></tt></a>, but releases the GIL.</p>
<p>This function returns an iterator over the directory entries in
<em>path</em>. The returned values are of type <a class="reference external" href="http://docs.python.org/3/library/stdtypes.html#textseq" title="(in Python v3.3)"><em class="xref std std-ref">str</em></a> in both Python 2.x and 3.x.</p>
<p>In Python 2.x <a class="reference external" href="http://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.3)"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a> is equivalent to <a class="reference external" href="http://docs.python.org/3/library/functions.html#bytes" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">bytes</span></tt></a> so all names
can be represented. In Python 3.x, surrogate escape coding (cf.
<a class="reference external" href="http://www.python.org/dev/peps/pep-0383/">PEP 383</a>) is used for
directory names that do not have a string representation.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.invalidate_inode">
<tt class="descclassname">llfuse.</tt><tt class="descname">invalidate_inode</tt><big>(</big><em>inode</em>, <em>attr_only=False</em><big>)</big><a class="headerlink" href="#llfuse.invalidate_inode" title="Permalink to this definition">¶</a></dt>
<dd><p>Invalidate cache for <em>inode</em></p>
<p>Instructs the FUSE kernel module to forgot cached attributes and
data (unless <em>attr_only</em> is True) for <em>inode</em>. This operation is
carried out asynchronously, i.e. the method may return before the
kernel has executed the request.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.invalidate_entry">
<tt class="descclassname">llfuse.</tt><tt class="descname">invalidate_entry</tt><big>(</big><em>inode_p</em>, <em>name</em><big>)</big><a class="headerlink" href="#llfuse.invalidate_entry" title="Permalink to this definition">¶</a></dt>
<dd><p>Invalidate directory entry</p>
<p>Instructs the FUSE kernel module to forget about the directory
entry <em>name</em> in the directory with inode <em>inode_p</em>. This operation
is carried out asynchronously, i.e. the method may return before
the kernel has executed the request.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.get_ino_t_bits">
<tt class="descclassname">llfuse.</tt><tt class="descname">get_ino_t_bits</tt><big>(</big><big>)</big><a class="headerlink" href="#llfuse.get_ino_t_bits" title="Permalink to this definition">¶</a></dt>
<dd><p>Return number of bits available for inode numbers</p>
<p>Attempts to use inode values that need more bytes will result in
<a class="reference external" href="http://docs.python.org/3/library/exceptions.html#OverflowError" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">OverflowError</span></tt></a>.</p>
</dd></dl>

<dl class="function">
<dt id="llfuse.get_off_t_bits">
<tt class="descclassname">llfuse.</tt><tt class="descname">get_off_t_bits</tt><big>(</big><big>)</big><a class="headerlink" href="#llfuse.get_off_t_bits" title="Permalink to this definition">¶</a></dt>
<dd><p>Return number of bytes available for file offsets</p>
<p>Attempts to use values whose representation needs more bytes will
result in <a class="reference external" href="http://docs.python.org/3/library/exceptions.html#OverflowError" title="(in Python v3.3)"><tt class="xref py py-obj docutils literal"><span class="pre">OverflowError</span></tt></a>.</p>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper"><h3><a href="index.html">Table Of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Installing LLFUSE</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">FUSE API Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Data Structures</a></li>
<li class="toctree-l1"><a class="reference internal" href="lock.html">The global lock</a></li>
<li class="toctree-l1"><a class="reference internal" href="operations.html">Request Handlers</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example File System</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="getting_started.html"
                        title="previous chapter">Getting started</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="data.html"
                        title="next chapter">Data Structures</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="data.html" title="Data Structures"
             >next</a> |</li>
        <li class="right" >
          <a href="getting_started.html" title="Getting started"
             >previous</a> |</li>
        <li><a href="index.html">LLFUSE 0.40 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2010-2013, Nikolaus Rath.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>