Method Fuse.Operations()->readdir()

class Fuse.Operations

Method readdir

int readdir(string path, function(string, int|void, Stdio.Stat|void:int) callback, int|void off, mixed|void opendir_handle)

Description

Get directory contents.

Parameter path

Path to the directory.

Parameter callback

Filler callback. Call the callback once per entry in the directory with the filename as the first argument. The optional second argument is the next value for off. A Stdio.Stat object for the entry may optionally be provided with the third argument. Returns 1 on failure (typically due to the buffer being full), at which time readdir() should return 0. The kernel will then call readdir() again with the latest reported off.

Parameter off

Directory offset to start at. The first call after opendir() has a value of 0. Later calls have the value from the last call of callback.

Parameter opendir_handle

The value that was returned from opendir().

Note

Do not forget to add entries for "." end "..".

Note

This function is required.

Returns

errno or 0. Returning 0 after a failed call of callback indicates that there are entries left. Otherwise returning 0 indicates that all entries have been registered.