Skip to main content

add_watch

Function add_watch 

Source
pub fn add_watch(fd: &Fd, path: &str, mask: u32) -> Result<i32, CoreError>
Expand description

Add a watch to an existing inotify instance.

§Arguments

  • fd - The inotify file descriptor.
  • path - Path to the file or directory to watch.
  • mask - Events to monitor (e.g., MODIFY_MASK).

§Errors

  • EACCES: Read access to the path is denied.
  • EBADF: The provided file descriptor is invalid.
  • EINVAL: The mask contains invalid bits or the path is invalid.
  • ENOENT: A component of the path does not exist.
  • ENOSPC: The user limit on the total number of inotify watches was reached.
  • ENOMEM: Insufficient kernel memory.