Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recursion back #1237

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/source/Reference/sr3_options.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,14 @@ given. This option also enforces traversing of symbolic links.
This option is being used to investigate some use cases, and may disappear in future.


recursive <flag> (default: on)
------------------------------

when scanning a path (for poll, post, cpost, or watch) if you encounter a directory
do you include it's contents as well? To only scan the specified directory
and no sub-directories, specify *recursive off*


rename <path>
-------------

Expand Down
6 changes: 5 additions & 1 deletion docs/source/fr/Reference/sr3_options.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,12 @@ donné. Cette option impose également la traversée de liens symboliques.

Cette option est utilisée pour étudier certains cas d'utilisation et pourrait disparaître à l'avenir.

<flag> recursive (par défaut : activé)
--------------------------------------


Lors de l'analyse d'un chemin (pour un *poll*, une *post*, un *cpost* ou un *watch*), si vous
rencontrez un répertoire, incluez-vous également son contenu ? Pour analyser uniquement le répertoire spécifié
et aucun sous-répertoire, spécifiez *recursive off*

rename <chemin>
---------------
Expand Down
2 changes: 1 addition & 1 deletion sarracenia/flowcb/gather/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def walk_priming(self, p):
try:
ow = self.observer.schedule(self.watch_handler,
d,
recursive=True)
recursive=self.o.recursive)
self.obs_watched.append(ow)
self.inl[dir_dev_id] = (ow, d)
logger.info(
Expand Down
16 changes: 9 additions & 7 deletions sarracenia/flowcb/poll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,22 @@ def poll_directory(self, pdir):

# post poll list

msgs.extend(self.poll_list_post(pdir, dir_dict, dir_dict.keys()))
if self.o.recursive:
msgs.extend(self.poll_list_post(pdir, dir_dict, dir_dict.keys()))

msgs.extend(self.poll_list_post(pdir, desclst, filelst))

# poll in children directory

sdir = sorted(dir_dict.keys())
for d in sdir:
if d == '.' or d == '..': continue
if self.o.recursive:
sdir = sorted(dir_dict.keys())
for d in sdir:
if d == '.' or d == '..': continue

#d_lspath = lspath + '_' + d
d_pdir = pdir + os.sep + d
#d_lspath = lspath + '_' + d
d_pdir = pdir + os.sep + d

msgs.extend(self.poll_directory(d_pdir))
msgs.extend(self.poll_directory(d_pdir))

return msgs

Expand Down
Loading