Class: FFI::Libfuse::Filesystem::PassThroughFile

Inherits:
Object
  • Object
show all
Includes:
MappedFiles
Defined in:
lib/ffi/libfuse/filesystem/pass_through_file.rb

Overview

Represents a single regular file at a given underlying path

Constant Summary

Constants included from MappedFiles

MappedFiles::HAS_XATTR

Instance Attribute Summary

Attributes included from MappedFiles

#accounting

FUSE Callbacks collapse

Instance Method Summary collapse

Methods included from MappedFiles

#getattr, #getxattr, #listxattr, #open, #read, #read_buf, #stat_mask, #statfs, #truncate, #utimens, #write, #write_buf

Constructor Details

#initialize(real_path) ⇒ PassThroughFile

Returns a new instance of PassThroughFile.

Parameters:

  • real_path (String)


14
15
16
# File 'lib/ffi/libfuse/filesystem/pass_through_file.rb', line 14

def initialize(real_path)
  @real_path = real_path
end

Instance Method Details

#create(path, perms, ffi) ⇒ Object

Adjust accounting to add a node

Raises:

  • (Errno::ENOENT)


28
29
30
31
32
33
# File 'lib/ffi/libfuse/filesystem/pass_through_file.rb', line 28

def create(path, perms, ffi)
  raise Errno::ENOENT unless root?(path)

  accounting&.adjust(0, +1)
  super
end

Adjust accounting to remove a node

Raises:

  • (Errno::ENOENT)


36
37
38
39
40
41
# File 'lib/ffi/libfuse/filesystem/pass_through_file.rb', line 36

def unlink(path)
  raise Errno::ENOENT unless root?(path)

  accounting&.adjust(0, -1)
  super
end