]> git.ipfire.org Git - thirdparty/samba.git/commit
s3:pylibsmb: add notify() support
authorStefan Metzmacher <metze@samba.org>
Tue, 27 Aug 2019 13:49:04 +0000 (13:49 +0000)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 Dec 2020 13:59:38 +0000 (13:59 +0000)
commit3ffb817506c032cdc05064abfbffb9f364e09a22
treeb3a9dc9385f440aa5ac0ee3a7c4af6fc6b1d3fdb
parentfde65c2f293ae3038c0052ea9d0dcdf3261d3fbc
s3:pylibsmb: add notify() support

The operation is a bit different from others,
as results are returned in an async fashion.
It returns a request handle.

  notify_req = conn.notify(fnum=fnum,
                           buffer_size=0xffff,
                           completion_filter=libsmb.FILE_NOTIFY_CHANGE_ALL,
                           recursive=True)

  # ... do other operations on conn.*() ...

  changes = notify_req.get_changes(wait=False)
  # changes is likely to be None if no result arrived yet

  # ... do other operations on conn.*() ...

  changes = notify_req.get_changes(wait=True)
  # changes is a list of change dictionaries
  # each containing "name" (a string) and
  # "action" (an integer, e.g. libsmb.NOTIFY_ACTION_REMOVED)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c