or null on error. Free the returned object with [gobject.object.ObjectWrap.unref].
File.monitorDirectory
gio.file_monitor.FileMonitor monitorDirectory(gio.types.FileMonitorFlags flags, gio.cancellable.Cancellable cancellable = null)Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.
If cancellable is not null, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error [gio.types.IOErrorEnum.Cancelled] will be returned.
It does not make sense for flags to contain [gio.types.FileMonitorFlags.WatchHardLinks], since hard links can not be made to directories. It is not possible to monitor all the files in a directory for changes made via hard links; if you want to do this then you must register individual watches with [gio.file.File.monitor].
Parameters
flags | a set of #GFileMonitorFlags |
cancellable | optional #GCancellable object, null to ignore |
Returns
a #GFileMonitor for the given file,
Throws
[ErrorWrap]