class_docstr: Linux inotify(7) API wrapper class.
  
  :param path:
      The directory path for which we want an inotify object.
  :type path:
      :class:`bytes`
  :param recursive:
      ``True`` if subdirectories should be monitored; ``False`` otherwise.
class_docstr_tok: ["Linux","inotify","(","7",")","API","wrapper","class",".",":","param","path",":","The","directory","path","for","which","we","want","an","inotify","object",".",":","type","path",":",":","class",":","`","bytes","`",":","param","recursive",":","``","True","``","if","subdirectories","should","be","monitored",";","``","False","``","otherwise","."]
docstr: Adds a watch (optionally recursively) for the given directory path
  to monitor events specified by the mask.
  
  :param path:
      Path to monitor
  :param recursive:
      ``True`` to monitor recursively.
  :param mask:
      Event bit mask.
code: def _add_dir_watch(self, path, recursive, mask):
      """
      Adds a watch (optionally recursively) for the given directory path
      to monitor events specified by the mask.
  
      :param path:
          Path to monitor
      :param recursive:
          ``True`` to monitor recursively.
      :param mask:
          Event bit mask.
      """
      if not os.path.isdir(path):
          raise OSError("Path is not a directory")
      self._add_watch(path, mask)
      if recursive:
          for root, dirnames, _ in os.walk(path):
              for dirname in dirnames:
                  full_path = os.path.join(root, dirname)
                  if os.path.islink(full_path):
                      continue
                  self._add_watch(full_path, mask)
  
imports: from __future__ import with_statement
  import os
  import errno
  import struct
  import threading
  import ctypes
  import ctypes.util
  from functools import reduce
  from ctypes import c_int, c_char_p, c_uint32
  from wandb_watchdog.utils import has_attribute
  from wandb_watchdog.utils import UnsupportedLibc
label_desc: Use image node_id 13 for calling the Inotify obj's underlying member method code with example usage: obj._add_dir_watch(path, recursive, mask) without return types