Operating Systems 2014F: Tutorial 8

From Soma-notes
Revision as of 08:12, 21 November 2014 by Soma (talk | contribs)
Jump to navigation Jump to search

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.