Method: FFI::Libfuse::FuseOperations.path_arg_methods

Defined in:
lib/ffi/libfuse/fuse_operations.rb

.path_arg_methods(fuse_callback) ⇒ Symbol

Helper to determine how to handle the path argument for a path callback

Examples:

def wrap_callback(fuse_method, *args)
    read, remove, add = FFI::Libfuse::FuseOperations.path_arg_methods(fuse_method)
    path = args.send(read)
    # ... do something with path

    path = args.send(remove)
    # ... do something to make an alternate path
    args.send(add, adjusted_path)
    delegate.send(fuse_methoed, *args)
end

Parameters:

  • fuse_callback (Symbol)

    callback method name (must be one of #path_callbacks)

Returns:

  • (Symbol, Symbol, Symbol)

    read, remove, add methods. [:last, :push, :pop] for :link, :symlink, :rename, [:first, :shift, :unshift] for everything else



102
103
104
# File 'lib/ffi/libfuse/fuse_operations.rb', line 102

def path_arg_methods(fuse_callback)
  CALLBACK_PATH_ARG_METHODS[fuse_callback]
end