Re: Tracking a file in real-time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 13 October 2007 13:22:44 Tony Nelson wrote:
> At 7:55 AM -0400 10/13/07, Garry T. Williams wrote:
> >On Thursday 11 October 2007 08:50:31 FS wrote:
> >> I have a need to track changes to a file being made in real-time.
> >
> >Curtis mentioned inotify(7).  Here's a small sample program using this
> >interface.
> 
> AFAICT, inotify cannot solve the OP's problem.  He already knows the file.
> He needs to know /where/ and /what/ changed in the file.  inotify can
> optimize the actual solution so it won't need polling.

Yes.  Inotify handles the when (you're called back whenever a file is
modified).  The application can then determine the what.

I don't know about the where.  Not sure I understand what you mean by
that.

Of course, if we knew more of the detailed requirements and data
structures, we could design the "diff" part of the application too.  I
assume the OP is capable of handling that part.

Finally, it may not be possible to get called back on each atomic
change.  That is, a monitoring application might get a call that was
the result of multiple changes.  (I don't know the design of inotify
well enough to say for sure.  I haven't experimented with the
IN_MODIFY event to be able to even guess, either.)  In that case, if
each individual change must be tracked, then you're probably left with
the "changers" need to be modified to accomplish the task.  That might
be the best solution anyway.  Designing a robust daemon task is one
thing.  Guaranteeing that it never misses a change is another thing.

-- 
Garry T. Williams --- +1 678 656-4579

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux