Qore fsevent Module ..
Loading...
Searching...
No Matches
FsEventPoller::AbstractFsEventPoller Class Referenceabstract

Ad-hoc file notification handler. More...

#include <FsEventPoller.qm.dox.h>

Inheritance diagram for FsEventPoller::AbstractFsEventPoller:
FsEventPoller::AbstractDelayedFsEventPoller

Public Member Methods

 constructor (string path, hash< AbstractFsEventPollerOptionInfo > options=< AbstractFsEventPollerOptionInfo >{})
 Construct a file poller. More...
 
abstract fileEvent (hash< FsEventInfo > event)
 Abstract method called whenever soem filesystem event occurs. More...
 

Private Member Methods

 setMask (string mask)
 Set filesystem mask like in shell etc. More...
 
 logInfo (string fmt)
 calls the "log_info" closure or call reference with important information
 
 logDetail (string fmt)
 calls the "log_detail" closure or call reference with detail information
 
 logDebug (string fmt)
 calls the "log_debug" closure or call reference with verbose debugging information
 
 initialRun (string path)
 Called in the constructor to get already existing files/events.
 

Detailed Description

Ad-hoc file notification handler.

This class is suitable for atomic file creation; where files are created with their full contents already in place. In case files are created and then written to in the final location, use AbstractDelayedFsEventPoller instead with a suitable delay.

Member Function Documentation

◆ constructor()

FsEventPoller::AbstractFsEventPoller::constructor ( string  path,
hash< AbstractFsEventPollerOptionInfo options = AbstractFsEventPollerOptionInfo >{} 
)

Construct a file poller.

Parameters
patha string with full path to the directory to be monitored
optionsa hash with options; see AbstractFsEventPollerOptionInfo for details about this parameter

◆ fileEvent()

abstract FsEventPoller::AbstractFsEventPoller::fileEvent ( hash< FsEventInfo >  event)
pure virtual

Abstract method called whenever soem filesystem event occurs.

Parameters
eventfile event info

◆ setMask()

FsEventPoller::AbstractFsEventPoller::setMask ( string  mask)
private

Set filesystem mask like in shell etc.

Converts a glob (standard filesystem) mask into a regex. Example: *.*, *.txt, someprefix_*.csv

File Name Masks and Matching

Parameters
maska string with file name mask

The documentation for this class was generated from the following file: