Name
SPVM::UV::Handle::FsEvent - FsEvent Handle for libuv
Description
UV::Handle::FsEvent in SPVM represents the file system event handle for libuv, corresponding to the uv_fs_event_t structure.
Super Class
Usage
use UV::Handle::FsEvent;
use UV::Constant;
my $fs_event = UV::Handle::FsEvent->new;
$fs_event->start(method : void ($fs_event_handle : UV::Handle::FsEvent, $filename : string, $events : int, $status : int) {
# Called when a file system event occurs
}, ".", UV::Constant->UV_FS_EVENT_RECURSIVE);
Fields
fs_event_cb
has fs_event_cb : rw UV::Callback::FsEvent;
The callback called when a file system event occurs.
Class Methods
new
static method new : UV::Handle::FsEvent ();
Creates a new UV::Handle::FsEvent object, and returns it.
Instance Methods
start
method start : void ($cb : UV::Callback::FsEvent, $path : string, $flags : int);
Starts the file system event handle with the callback $cb, the target path $path, and options $flags.
The callback $cb is stored in "fs_event_cb" field.
The callback $cb is invoked when a file system event occurs on $path.
This method calls the uv_fs_event_start function.
Exceptions:
If $cb is not defined, an exception is thrown.
If $path is not defined, an exception is thrown.
If uv_fs_event_start fails, an exception is thrown.
stop
method stop : void ();
Stops the file system event handle.
This method calls the uv_fs_event_stop function.
Exceptions:
If uv_fs_event_stop fails, an exception is thrown.
getpath
method getpath : string ();
Gets the path being monitored.
This method calls the uv_fs_event_getpath function, and returns the path string.
Exceptions:
If uv_fs_event_getpath fails, an exception is thrown.
Details
Interfaces
Enumerations
Well Known Child Classes
See Also
UV::Handle, UV::Callback::FsEvent, UV::Constant
Repository
Author
Yuki Kimoto kimoto.yuki@gmail.com
Copyright & License
Copyright (c) 2026 Yuki Kimoto
MIT License