Skip to content

Fs

flowtask.hooks.types.fs

FSWatchdog

FSWatchdog(*args, **kwargs)

Bases: BaseWatchdog

FSWatchdog. Checking for changes in the filesystem and dispatch events.

FsHandler

FsHandler(parent, patterns=None, *args, **kwargs)

Bases: PatternMatchingEventHandler

on_modified

on_modified(event)

Handle file modification events.

This method is called when a file modification event is detected. It processes the event and calls the appropriate actions if the event meets certain criteria.

event (FileSystemEvent): The event object containing information about the file modification.

Returns: None

Note: - The method returns early if the event is for a directory or if 'modified' is not in the parent's events list. - It also returns early if the file was recently created to avoid duplicate processing. - If the file has zero size, a warning is logged. - The event is processed and actions are called twice with the same arguments.

process

process(event)

Process the event if it matches the patterns and isn't a directory.

zero_size

zero_size(filepath)

Check if the file is of zero size.