=========================== Type deai.plugin.file:Watch =========================== .. lua:module:: deai.plugin.file.Watch See :lua:meth:`file.watch ` for more information about this type Methods ========== .. list-table:: :header-rows: 0 * - :lua:meth:`add(paths) ` - Add files * - :lua:meth:`add_one(path) ` - Add a file * - :lua:meth:`remove(path) ` - Remove a file .. lua:method:: add(paths) -> integer :rtype: integer :type paths: [string] :param paths: Add files Add new files to a watch, returns 0 if successful. .. lua:method:: add_one(path) -> integer :rtype: integer :type path: string :param path: Add a file Add a single new file to a watch, returns 0 if successful. .. lua:method:: remove(path) -> integer :rtype: integer :type path: string :param path: Remove a file Returns 0 if successful. If the file is not in the watch, return :code:`-ENOENT`. Signals ========== .. list-table:: :header-rows: 0 * - :lua:sgnl:`access(path, file_name) ` - A file was accessed. * - :lua:sgnl:`attrib(path, file_name) ` - A file's metadata was changed. * - :lua:sgnl:`close-nowrite(path, file_name) ` - A file or directory not opened for iting was closed. * - :lua:sgnl:`close-write(path, file_name) ` - A file opened for writing was closed. * - :lua:sgnl:`create(path, file_name) ` - A file or directory is created. * - :lua:sgnl:`delete(path, file_name) ` - A file or directory was deleted from watched directory. * - :lua:sgnl:`delete-self(path, file_name) ` - A watched file or directory was itself deleted. * - :lua:sgnl:`modify(path, file_name) ` - A file was modified. * - :lua:sgnl:`move-from(path, file_name, cookie) ` - A file in a watched directory was renamed to a new place. * - :lua:sgnl:`move-self(path, file_name) ` - A watched file or directory was itself moved * - :lua:sgnl:`move-to(path, file_name, cookie) ` - A file was renamed into a watched directory. * - :lua:sgnl:`open(path, file_name) ` - A file or directory was opened .. lua:signal:: access(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file was accessed. .. lua:signal:: attrib(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file's metadata was changed. .. lua:signal:: close-nowrite(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file or directory not opened for iting was closed. .. lua:signal:: close-write(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file opened for writing was closed. .. lua:signal:: create(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file or directory is created. .. lua:signal:: delete(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file or directory was deleted from watched directory. .. lua:signal:: delete-self(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A watched file or directory was itself deleted. .. lua:signal:: modify(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file was modified. .. lua:signal:: move-from(path, file_name, cookie) :type path: string :param path: :type file_name: string :param file_name: :param cookie: unique integer associated with this move, can be used to pair this event with a :lua:sgnl:`move-to` event. :type cookie: integer A file in a watched directory was renamed to a new place. .. lua:signal:: move-self(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A watched file or directory was itself moved .. lua:signal:: move-to(path, file_name, cookie) :type path: string :param path: :type file_name: string :param file_name: :param cookie: unique integer associated with this move, can be used to pair this event with a :lua:sgnl:`move-from` event. :type cookie: integer A file was renamed into a watched directory. .. lua:signal:: open(path, file_name) :type path: string :param path: :type file_name: string :param file_name: A file or directory was opened