Module: FFI::Libfuse::Adapter::Fuse2Compat::Prepend

Includes:
FFI::Libfuse::Adapter
Defined in:
lib/ffi/libfuse/adapter/fuse2_compat.rb

Overview

Wrapper shim for fuse methods to ensure compatibility with Fuse2

Instance Method Summary collapse

Methods included from FFI::Libfuse::Adapter

#fuse_super_respond_to?

Instance Method Details

#chmod(path, mode, fuse_file_info = nil) ⇒ Object



30
31
32
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 30

def chmod(path, mode, fuse_file_info = nil)
  super
end

#chown(path, uid, gid, fuse_file_info = nil) ⇒ Object



26
27
28
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 26

def chown(path, uid, gid, fuse_file_info = nil)
  super
end

#fuse_flagsObject



60
61
62
63
64
65
66
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 60

def fuse_flags
  res = defined?(super) ? super : []
  return res unless respond_to?(:init_fuse_config)

  FUSE_CONFIG_FLAGS.each { |opt| res << opt if fuse_config.send(opt) }
  res
end

#fuse_options(args) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 51

def fuse_options(args)
  super if defined?(super)
  return unless respond_to?(:init_fuse_config)

  FUSE_CONFIG_ONLY_ATTRIBUTES.each do |opt|
    args.add("-o#{opt}") if fuse_config.send(opt)
  end
end

#fuse_respond_to?(fuse_method) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
46
47
48
49
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 43

def fuse_respond_to?(fuse_method)
  # getdir is never supported here anyway
  # fgetattr and ftruncate already fallback to the respective basic method
  return false if %i[getdir fgetattr ftruncate].include?(fuse_method)

  super
end

#init(*args) ⇒ Object



22
23
24
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 22

def init(fuse_conn_info, fuse_config = nil)
  super
end

#readdir(path, buffer, filler, offset, fuse_file_info, fuse_readdir_flag = 0) ⇒ Object



38
39
40
41
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 38

def readdir(path, buffer, filler, offset, fuse_file_info, fuse_readdir_flag = 0)
  f3_fill = proc { |buf, name, stat, off = 0, _fuse_fill_dir_flag = 0| filler.call(buf, name, stat, off) }
  super(path, buffer, f3_fill, offset, fuse_file_info, fuse_readdir_flag)
end

#truncate(path, size, fuse_file_info = nil) ⇒ Object



18
19
20
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 18

def truncate(path, size, fuse_file_info = nil)
  super
end

#utimens(path, times, fuse_file_info = nil) ⇒ Object



34
35
36
# File 'lib/ffi/libfuse/adapter/fuse2_compat.rb', line 34

def utimens(path, times, fuse_file_info = nil)
  super
end