Skip to content

A wrapper for python-fuse that makes it more friendly to use

Notifications You must be signed in to change notification settings

redballoonsecurity/shortfuse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shortfuse

This module is aims to make it easier to leverage the fusepy <https://github.com/fusepy/fusepy> library. It offers the following improvements:

  • Method documentation. While fusepy provide some documentation, a lot of implementation details are lacking.
  • Ease of use. Shortfuse offers many base classes to represent common file system objects and their attributes. These objects take care of representing the tree structure commonly associated with file system. This also opens up opportunities for reducing duplicated logic. A specialized type of file can extend the functionality of a file commonly encountered in your custom file system.

Consider a file system wih the following nodes:

  • / : The root of the file system
  • /dir1 : A regular directory
  • /dir1/file1 : A regular file
  • /dir1/file2 : A regular file
  • /file1 : A regular file
  • /file2 : A link pointing to /dir1/file4

Shortfuse would use the following objects to represent it:

Sample diagram of a shortfuse object relationship

Each arrow in the diagram show a reference from one object to the other. The diagram examplifies the 3 basic classes used to implement a custom file system with shortfuse:

Note

It is important to remember that all of these classes inherit from the :py:class:`~shortfuse.node.Node` class and some of its operations must be overridden.

When implementing a filesystem using shortfuse, your first step should be to override these classes. By default, most operations they define will result in an EPERM error to denote that the functionality is not available in the filesystem. Additionally, you may want to override the :py:class:`~shortfuse.attributes.NodeAttributes`, :py:class:`~shortfuse.attributes.NodeExtraAttributes` and :py:class:`~shortfuse.attributes.NodeFSAttributes` classes.

To get you started, a sample in memory filesystem implementation is available in the :py:mod:`shortfuse.extra.memory` package. The reason this package is in the main codebase is that it can be useful when implementing your own filesystem, especially the :py:class:`~shortfuse.extra.memory.MemoryNodeAttributes` and :py:class:`~shortfuse.extra.memory.MemoryNodeExtraAttributes` classes.

Testing

This module also provides a :py:mod:`tests.shortfuse` package that contains utility classes that you may find useful while testing your custom file system. You may want to use the following:

Installation

To install the authproxy server, run:

pip install shortfuse

About

A wrapper for python-fuse that makes it more friendly to use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published