LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 11-25-2005, 02:37 AM   #1
dhammika
Member
 
Registered: Dec 2003
Location: Colombo. (Sri Lanka)
Distribution: RH 9, RH AS 3, Fedora Core
Posts: 65

Rep: Reputation: 15
Track File modification


Hi all


Can anyone help me to write a program to track a file modification?
on line in a UNIX system.

In detail

If i have file call test.txt in a directory. And a particular program is appending or modify that file. And that program is compiled and no way to change. When it starts appending or modification I need to track the original file before it change.

Thanks
 
Old 11-25-2005, 06:03 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
There exist programs (daemons) that can notify other programs (applications) when certain files change.

I don't have any experience with them, so I'm not sure if they can notify other programs before the change occurs. I think that may not be possible.

But you could copy your test.txt before starting your program. Then have "fam" or "dnotify" notify another program when the files changes, and make a new copy of test.txt.

Some information on file-change notifying daemons ("fam" or "dnotify"):

http://www.devchannel.org/devtoolsch.../2146252.shtml
http://savannah.nongnu.org/projects/fam/
http://www.lambda-computing.com/projects/dnotify/
http://www.die.net/doc/linux/man/man1/dnotify.1.html
 
  


Reply



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
time stamp for file modification youngstorm Linux - Newbie 2 11-01-2005 03:46 PM
file modification in linux nov Linux - Newbie 3 06-05-2005 09:02 AM
Heeelp! Preserving file modification attribute Slackovado Slackware 4 04-01-2005 02:31 AM
Heeelp! How to preserve file date modification attribute Slackovado Slackware 1 03-30-2005 09:36 AM
File Modification Date Comparison MadTurki Programming 7 03-08-2004 04:02 PM

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

All times are GMT -5. The time now is 10:42 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