Method: FFI::Libfuse::FuseOperations#readdir

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

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

This method is abstract.

Read directory

The filesystem may choose between two modes of operation:

1) The readdir implementation ignores the offset parameter, and passes zero to the filler function's offset. The filler function will not return '1' (unless an error happens), so the whole directory is read in a single readdir operation.

2) The readdir implementation keeps track of the offsets of the directory entries. It uses the offset parameter and always passes non-zero offset to the filler function. When the buffer is full (or an error happens) the filler function will return '1'.

Parameters:

  • path (String)
  • buffer (FFI::Pointer)
  • filler (Proc<FFI::Pointer,String,Stat,Integer,Integer=0>)

    the filler function to be called for each directory entry, ie filler.call(buffer,next_name,next_stat,next_offset, fuse_fill_dir_flag)

  • offset (Integer)

    the starting offset

  • fuse_file_info (FuseFileInfo)
  • fuse_readdir_flag (Symbol) (defaults to: 0)

    (Fuse3 only)

Returns:

  • (Integer)

    0 on success or -ve errno



# File 'lib/ffi/libfuse/fuse_operations.rb', line 483