Class FuseFS::PathMapperFS
In: lib/fusefs/pathmapper.rb
Parent: FuseDir

A FuseFS that maps files from their original location into a new path eg tagged audio files can be mapped by title etc…

Methods

can_write?   cleanup   contents   create   directory?   file?   mapDirectory   mapFile   map_directory   map_file   mkdir   new   node   open_mode   raw_close   raw_open   raw_read   raw_sync   raw_write   read_file   size   statistics   times   unmap   write_to   xattr  

Classes and Modules

Class FuseFS::PathMapperFS::MNode

Attributes

allow_write  [RW]  should filesystem support writing through to the real files @return [Boolean]
    default is false
stats  [R]  @return [StatsHelper] accumulated filesystem statistics
use_raw_file_access  [RW]  should raw file access should be used - useful for binary files @return [Boolean]
  default is false

Public Class methods

Creates a new Path Mapper filesystem over an existing directory @param [String] dir @param [Hash] options @yieldparam [String] file path to map @yieldreturn [String] @see initialize @see map_directory

Create a new Path Mapper filesystem @param [Hash] options @option options [Boolean] :use_raw_file_access @option options [Boolean] :allow_write @option options [Integer] :max_space available space for writes (for df) @option options [Integer] :max_nodes available nodes for writes (for df)

Convert FuseFS raw_mode strings back to IO open mode strings

Public Instance methods

@!visibility private We can only write to existing files because otherwise we don‘t have anything to back it

Deletes files and directories. Yields each {node} in the filesystem and deletes it if the block returns true

Useful if your filesystem is periodically remapping the entire contents and you need to delete entries that have not been touched in the latest scan

@yieldparam [Hash] filesystem node @yieldreturn [true,false] should this node be deleted

@!visibility private

@!visibility private

@!visibility private

mapDirectory(*dirs)

Alias for map_directory

mapFile(real_path,new_path,options = {})

Alias for map_file

Recursively find all files and map according to the given block @param [String…] dirs directories to list @yieldparam [String] file path to map @yieldreturn [String] the mapped path @yieldreturn nil to skip mapping this file

Add (or replace) a mapped file

@param [String] real_path pointing at the real file location @param [String] new_path the mapped path @param [Hash<Symbol,Object>] options metadata for this path @option options [Hash<String,String>] :xattr hash to be used as extended attributes @return [MNode]

   a node representing the mapped path. See {#node}

Note we don‘t impleemnt can_mkdir? so this can only be called by code. Really only useful to create empty directories

Retrieve in memory node for a mapped path

@param [String] path @return [MNode] in memory node at path @return nil if path does not exist in the filesystem

@!visibility private

@!visibility private Will create, store and return a File object for the underlying file for subsequent use with the raw_read/raw_close methods expects file? to return true before this method is called

@!visibility private only called if option :raw_reads is not set

@!visibility private

@!visibility private

@!visibility private

Takes a mapped file name and returns the original real_path

@!visibility private

@!visibility private

[Validate]