# File system plugins

Those plugins provide methods to access files on various storages. For instance, ‘python’ plugin uses the python API to access local files (file://), so does the GIO implementation (openpaperwork-gtk). Memory plugin allow storing data in filesystem-like manner (memory://). Later other plugins could provide access to other storages (MariaDB, HTTP, etc).

The reference implementation is ‘python’.

A fake/mock implementation is provided for testing. It behaves in a way similar to the memory plugin.

## Python-based implementation

## In-Memory implementation

Provides support for URIs “memory://”. Those files are actually stored in memory. It is only useful for temporary files. It has been made as a plugin so it can easily be disabled on low-memory systems (will fall back on gio.fs –> real on-disk files).

class openpaperwork_core.fs.memory.Plugin
  PRIORITY = 100
  fs_copy(old_url, new_url)
  fs_exists(url)
  fs_get_mime(url)
  fs_get_mtime(url)
  fs_getsize(url)
  fs_hide(url)
  fs_isdir(url)
  fs_iswritable(url)
  fs_listdir(url)
  fs_mkdir_p(url)
  fs_mktemp(prefix=None, suffix=None, mode='w+b', on_disk=False, **kwargs)
  fs_open(uri, mode='r', needs_fileno=False, **kwargs)
  fs_recurse(parent_url, dir_included=False)
  fs_rename(old_url, new_url)
  fs_rm_rf(url, **kwargs)
  fs_unlink(url, **kwargs)