Difference between revisions of "Operating Systems 2014F: Tutorial 8"

From Soma-notes
Jump to navigation Jump to search
(Created page with "'''This tutorial is not yet finalized.''' Use [https://github.com/terencehonles/fusepy fusepy]. To run: * sudo install python-setuptools * sudo usermod -a -G fuse student * ...")
 
Line 1: Line 1:
'''This tutorial is not yet finalized.'''
'''This tutorial is not yet finalized.'''


Use [https://github.com/terencehonles/fusepy fusepy].
In this tutorial you will be learning about [http://fuse.sourceforge.net/ filesystem in userspace (FUSE)] using an example from [https://github.com/terencehonles/fusepy fusepy].  Note the example code is written in Python, not C.  The code should be readable even if you are not familiar with Python.  When you make changes, keep in mind the following:
* Indentation, not curly braces, is used to denote block structure.  Thus indentation matters!  Pay particular attention to spaces versus tabs.  (When in doubt, don't use tabs.)
* To create a local variable, just assign to it.  Python will make sure it is only defined within that function.
* If you just type "python" on the command line you get a read-eval-print loop where you can try things out.
* Python is heavily object oriented, so expect to use methods more than straight functions.


To run:
To get going, first download the [fuse example code] in a zip file.  Unpack it and change into the directory in a terminal.  You should see two files: fusell.py and memoryll.py (both listed below).  We will be running and modifying memoryll.py.  For it to work, however, fusell.py has to be in the same directory as memoryll.py.
* sudo install python-setuptools
* sudo usermod -a -G fuse student
* unpack fusepy zip, cd into it
* sudo python setup.py install

Revision as of 08:12, 21 November 2014

This tutorial is not yet finalized.

In this tutorial you will be learning about filesystem in userspace (FUSE) using an example from fusepy. Note the example code is written in Python, not C. The code should be readable even if you are not familiar with Python. When you make changes, keep in mind the following:

  • Indentation, not curly braces, is used to denote block structure. Thus indentation matters! Pay particular attention to spaces versus tabs. (When in doubt, don't use tabs.)
  • To create a local variable, just assign to it. Python will make sure it is only defined within that function.
  • If you just type "python" on the command line you get a read-eval-print loop where you can try things out.
  • Python is heavily object oriented, so expect to use methods more than straight functions.

To get going, first download the [fuse example code] in a zip file. Unpack it and change into the directory in a terminal. You should see two files: fusell.py and memoryll.py (both listed below). We will be running and modifying memoryll.py. For it to work, however, fusell.py has to be in the same directory as memoryll.py.