![]() Note: thisĮvent is only generated for files created directly in aĭirectory being monitored subdirectories are not automaticallyįAMMoved FAMMoved events never occur. Is only generated when the last one finishes.Ī file was created in a directory being monitored. If multiple processes from an executable are running, this event ![]() If multiple processes execute the same file, thisĮvent only occurs when the first process starts.Īn executable file being monitored which was running finished. This event is also generated when monitoring starts onĪn executable file or shared library being monitored startedĮxecuting. Some value which can be obtained with fstat(1) changed for aĪ file or directory being monitored was deleted or its name wasĬhanged. The code field of this structure contains one of the following ![]() This structure uniquely identifies the request so that it mayīe cancelled, using FAMCancelMonitor or suspended, usingĬhanges to files and directories are encoded in the FAMEvent structure. When fam is called on to monitor a file, it passes back a FAMRequest The FAMConnection, rather than accessing it directly. ![]() Use the macro FAMCONNECTION_GETFD to access the file descriptor inside Has all the information in it to communicate to fam. Subsequently it is passed into all FAM procedures. The FAMConnection data structure is created when opening a connection toįAM. Resources associated with files still being monitored and to closeĭATA STRUCTURES The FAMConnection Structure Before the application exits, it should call FAMClose to free Monitoring again, it calls FAMResumeMonitor.ĥ. Temporarily suspend monitoring of a file or directory, it may callįAMSuspendMonitor. When the application is through monitoring a file or directory, it Pending, FAMNextEvent blocks until an event occurs.Ĥ. Alternatively, call FAMPending (orįAMNextEvent) periodically to check the socket connection to fam to The fam socket is active, andğAMNextEvent when FAMPending indicates Select on the fam socket file descriptor and call FAMPending when Tell fam which files and directories to monitor by callingįAMMonitorFile and FAMMonitorDirectory to express interest in filesģ. Pass back a FAMConnection structure used in all fam procedures.Ģ. Create a connection to fam by callingğAMOpen. USING FAM Here are the steps required to use FAM in an application:ġ. The fam process is started when the first connectionįrom any application to it is opened. Fam generates events on a socket to communicate with The library ``libC.a'' (``-lC'') must also beĪn application calls routines described here to establish a list of filesįor fam to monitor. Routines for communicating with the fam(1M) server process areįound in ``libfam.a'', which is loaded if the option ``-lfam'' is used SYNOPSIS #include extern int FAMOpen(FAMConnection* fc) extern int FAMClose(FAMConnection* fc) extern int FAMMonitorDirectory(FAMConnection *fc, char *filename, FAMRequest* fr, void* userData) extern int FAMMonitorFile(FAMConnection *fc, char *filename, FAMRequest* fr, void* userData) int FAMSuspendMonitor(FAMConnection *fc, FAMRequest *fr) int FAMResumeMonitor(FAMConnection *fc, FAMRequest *fr) int FAMCancelMonitor(FAMConnection *fc, FAMRequest *fr) int FAMNextEvent(FAMConnection *fc, FAMEvent *fe) int FAMPending(FAMConnection* fc) typedef struct FAMEvent FAM(3X) FAM(3X) extern int FAMErrno extern char *FamErrlist DESCRIPTION FAM monitors files and directories, notifying interested applications ofĬhanges. FAM(3X) FAM(3X) NAME fam - FileĚlteration Monitor (FAM) library routines
0 Comments
Leave a Reply. |