FileMonitor
Object Hierarchy:
GLib.FileMonitor
GLib.FileMonitor
GLib.FileMonitor
GLib.Object
GLib.Object
GLib.Object->GLib.FileMonitor
Description:
[ CCode ( type_id = "g_file_monitor_get_type ()" ) ]public abstract class FileMonitor : Object
Monitors a file or directory for changes.
To obtain a FileMonitor for a file or directory, use
monitor , monitor_file , or
monitor_directory .
To get informed about changes to the file or directory you are monitoring, connect to the
changed signal. The signal will be emitted in the thread-default main
context of the thread that the monitor was created in (though if the global default main context is blocked, this may cause
notifications to be blocked even if the thread-default context is still running).
Example: File monitoring:
public static int main () { try { File file = File.new_for_path (Environment.get_home_dir ()); FileMonitor monitor = file.monitor (FileMonitorFlags.NONE, null ); print ("Monitoring: %s \n " , file.get_path ()); monitor.changed.connect ((src, dest, event) => { if (dest != null ) { print (" %s : %s , %s \n " , event.to_string (), src.get_path (), dest.get_path ()); } else { print (" %s : %s \n " , event.to_string (), src.get_path ()); } }); new MainLoop ().run (); } catch (Error err) { print ("Error: %s \n " , err.message); } return 0 ; }
valac --pkg gio-2.0 GLib.File.monitor.vala
Content:
Properties:
Creation methods:
Methods:
Signals:
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref