Git Product home page Git Product logo

shortfuse's Introduction

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

shortfuse's People

Contributors

rbs-alex avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.