Module: FuseFS

Defined in:
lib/fusefs.rb

Defined Under Namespace

Classes: DirEntry, FileEntry, Stat, StatVFS

Constant Summary collapse

S_IFDIR =
0o0040000
S_IFREG =
0o0100000

Class Method Summary collapse

Class Method Details

.Entries(path, entries) ⇒ Object



41
42
43
44
45
# File 'lib/fusefs.rb', line 41

def Entries(path, entries)
  entries.map do |entry|
    @root.getattr(File.join(path, entry))
  end
end

.exitObject



37
38
39
# File 'lib/fusefs.rb', line 37

def exit
  @running = false
end

.runObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fusefs.rb', line 18

def run
  fd = fuse_fd

  begin
    io = IO.for_fd(fd)
  rescue Errno::EBADF
    raise "fuse is not mounted"
  end

  while @running
    IO.select([io])
    process
  end
end

.unmountObject



33
34
35
# File 'lib/fusefs.rb', line 33

def unmount
  system("umount #{@mountpoint}")
end