LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-07-2004, 02:57 AM   #1
laikos
Member
 
Registered: Nov 2002
Distribution: Slackware 8.1
Posts: 30

Rep: Reputation: 15
Question 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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
open SuSE 9.3 Logout from an opened file langbein SUSE / openSUSE 2 11-21-2005 03:19 PM
starting script, init by copy/create file in (samba) folder? muab Linux - General 7 06-22-2005 06:02 PM
can copy-paste or create new file/folder, if boot from live cd gjo Linux - Distributions 3 09-17-2004 08:43 AM
Run script during file copy or create in directory neranjana Linux - General 1 01-13-2004 06:57 AM
Does Slackware 9 include the File Alteration Monitor (FAM) alim Slackware 1 03-22-2003 07:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration