Class FuseFS::MetaDir
In: lib/fusefs/metadir.rb
Parent: Object

A full in-memory filesystem defined with hashes. It is writable to the user that mounted it may create and edit files within it, as well as the programmer

Usage

  root = Metadir.new()
  root.mkdir("/hello")
  root.write_to("/hello/world","Hello World!\n")
  root.write_to("/hello/everybody","Hello Everyone!\n")

  FuseFS.start(mntpath,root)

Because Metadir is fully recursive, you can mount your own or other defined directory structures under it. For example, to mount a dictionary filesystem (see samples/dictfs.rb), use:

  root.mkdir("/dict",DictFS.new())

Methods

can_delete?   can_mkdir?   can_rmdir?   can_write?   contents   delete   directory?   file?   mkdir   new   read_file   rename   rmdir   scan_path   size   split_path   statistics   write_to   xattr  

Constants

DEFAULT_FS = FuseDir.new()

Attributes

stats  [R]  @return [StatsHelper] helper for filesystem accounting (df etc)

Public Class methods

Public Instance methods

Delete a file

mkdir - does not make intermediate dirs!

Delete an existing directory make sure it is not empty

can_write only applies to files… see can_mkdir for directories…

List directory contents

path is ignored? - recursively calculate for all subdirs - but cache and then rely on fuse to keep count

Extended attributes

[Validate]