FAM monitoring file opened/create/copy
Hi All,
I've written some code to monitor file on local directory. However, my problem is I would like to report to a server that a changes has happened and I would like to post the changed, newly created file name to the server.
The scenario is when I try to copy large file to local directory that I've been monitored. FAM will report the file has been created (correct) and changed when the file is being copied. Is there anyway to differentiate that the file is currently being copied and file is actually new?
These are the FAM API that I 've been using:
/****************************************************/
FAMChanged Some value of the file or directory that can be obtained with lstat(2) changed.
FAMDeleted A file or directory being monitored was deleted.
FAMStartExecuting A monitored, executable file started executing. The event occurs only the first time the file is executed.
FAMStopExecuting A monitored, executable file that was running finished. If multiple processes from an executable are running, this event is generated only when the last one finishes.
FAMCreated A file was created in a directory being monitored.
FAMAcknowledge FAM generates a FAMAcknowledge event in response to a call to FAMCancelMonitor(). If you specify an invalid request, that is, a relative path, FAM automatically cancels the request and immediately sends a FAMAcknowledge event.
FAMExists When the application requests that a file be monitored, FAM generates a FAMExists event for that file (if it exists). When the application requests that a directory be monitored, FAM generates a FAMExists event for that directory (if it exists) and every file contained in that directory.
FAMEndExist When the application requests a file or directory be monitored, FAM generates a FAMEndExist event after the last FAMExists event. (Therefore if you monitor a file, FAM generates a single FAMExists event followed by a FAMEndExist event.)
/****************************************************/
Thanks for the help
|