def _addChildren(self, iwp):
        try:
            listdir = iwp.path.children()
        except OSError:
            # Somebody or something (like a test) removed this directory while
            # we were in the callLater(0...) waiting. It doesn't make sense to
            # process it anymore
            return

        # note that it's true that listdir will only see the subdirs inside
        # path at the moment of the call but path is monitored already so if
        # something is created we will receive an event.
        for f in listdir:
            # It's a directory, watch it and then add its children
            if f.isdir():
                wd = self.watch(
                    f, mask=iwp.mask, autoAdd=True,
                    callbacks=iwp.callbacks
                )
                iwp._notify(f, IN_ISDIR|IN_CREATE)
                # now f is watched, we can add its children the callLater is to
                # avoid recursion
                self.reactor.callLater(0,
                    self._addChildren, self._watchpoints[wd])

            # It's a file and we notify it.
            if f.isfile():
                iwp._notify(f, IN_CREATE|IN_CLOSE_WRITE)
Record keeping for primitive system parameters
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/inotify.py/INotify._addChildren--crossover with--dataset/ETHPy150Open black-perl/ptop/ptop/statistics/statistics.py/Statistics.__init__