public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Detecting changes in a directory tree
@ 2003-01-16 18:58 Jeroen van Disseldorp
  2003-01-17  0:59 ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Jeroen van Disseldorp @ 2003-01-16 18:58 UTC (permalink / raw)
  To: linux-kernel

Hi,

For an application I'm writing I need to know if files in a certain 
directory tree were modified and/or deleted by another process. I 
assume that that tree is mounted on the machine that my app is running 
on. The device it has mounted on can be a local HD, but it can also be 
hosted remotely and mounted over nfs.

I know of FAM, but this is documented to only watch a directory 1 level 
deep, and I need the whole tree to be monitored. Does anyone know a 
solution for this? Does the kernel provide facilities for this?

(Please send me replies directly or via CC, as I am not subscribed to 
the kernel mailinglist)

Regards,
  Jeroen van Disseldorp         mailto:jdizzl@xs4all.nl
-- 
Be the change you wish to see in the world    -- Gandhi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Detecting changes in a directory tree
  2003-01-16 18:58 Jeroen van Disseldorp
@ 2003-01-17  0:59 ` Adrian Bunk
  2003-01-17  3:54   ` Jeroen van Disseldorp
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2003-01-17  0:59 UTC (permalink / raw)
  To: Jeroen van Disseldorp; +Cc: linux-kernel

On Thu, Jan 16, 2003 at 01:58:36PM -0500, Jeroen van Disseldorp wrote:

> Hi,

Hi Jeroen,

> For an application I'm writing I need to know if files in a certain 
> directory tree were modified and/or deleted by another process. I 
> assume that that tree is mounted on the machine that my app is running 
> on. The device it has mounted on can be a local HD, but it can also be 
> hosted remotely and mounted over nfs.
> 
> I know of FAM, but this is documented to only watch a directory 1 level 
> deep, and I need the whole tree to be monitored. Does anyone know a 
> solution for this? Does the kernel provide facilities for this?
>...

with a kernel >= 2.4.19 dnotify [1] might do what you want.

> Regards,
>   Jeroen van Disseldorp         mailto:jdizzl@xs4all.nl

cu
Adrian

[1] http://www.student.lu.se/~nbi98oli/dnotify.html

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Detecting changes in a directory tree
  2003-01-17  0:59 ` Adrian Bunk
@ 2003-01-17  3:54   ` Jeroen van Disseldorp
  0 siblings, 0 replies; 4+ messages in thread
From: Jeroen van Disseldorp @ 2003-01-17  3:54 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Thursday 16 January 2003 19:59, Adrian Bunk wrote:
> with a kernel >= 2.4.19 dnotify [1] might do what you want.

Close, but is doesn't do it quite for me. I understand the problem of 
traversing inodes back up the tree, once they have changed, to see 
whether someone wants to receive an event. However I am not convinced 
that this is necessary. The idea I had was the following:

I would like to have a passthrough kind of filesystem (lets call is myfs 
for now) that can mount other parts of the filesystem and just maps 
everything to the original tree. For instance, I would mount /var on 
/mnt/var, using myfs. Everything from /mnt/var is directly mapped to 
/var.

The clue of this is that myfs *knows* about the notification, because it 
has to send notification to userspace for *every* inode. So if anything 
is written in /mnt/var, it can notify userspace. BTW for my app it 
would be acceptable that direct changes in /var don't lead to any 
events.

I haven't thought out the interface to userspace yet, but I think that 
can be worked out. Let me know if I'm making any sense here.

Regards,
  Jeroen                           mailto:jdizzl@xs4all.nl
-- 
Be the change that you want to see in the world    -- Gandhi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Detecting changes in a directory tree
@ 2003-01-17 12:58 Jon Burgess
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Burgess @ 2003-01-17 12:58 UTC (permalink / raw)
  To: jdizzl; +Cc: linux-kernel



There are a number of existing userland filesystems, try:

http://lufs.sourceforge.net/lufs/intro.html
"LUFS is a hybrid userspace filesystem framework supporting an indefinite number
of filesystems (localfs, sshfs, ftpfs, cardfs and cefs implemented so far)
transparently for any application."

http://uservfs.sourceforge.net/
"POrtable Dodgy Filesystems in Userland (hacK) version 2. Once upon a time,
there was project called podfuk. It used nfs, and nfs sucks. On one sunny night,
its author had nothing better to do, and he started creating fake cache manager
for coda. It worked in two days, and it worked pretty good. At least, ugly nfs
was gone."

http://hierfs.sourceforge.net/
"Welcome to the hierachical storage filesystem. This project aims to create a
simple way of managing a vast amount of data over multiple CD-R media. This is
done by creating a virtual filesystem simulating all files on the CDs as if they
were online on the harddisk. When a file is accessed, a dialog box asks for the
correct CD. So any program can be used to acces the data without needing to know
the files are on CD. "

http://vcfs.sourceforge.net/
"VCFS is the Virtual CVS FileSystem. VCFS provides a user-space NFS server that
allows local or remote CVS repositories to be mounted as a filesystem. It works
with existing CVS servers, including those used by SourceForge."

     Jon



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-17 12:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-17 12:58 Detecting changes in a directory tree Jon Burgess
  -- strict thread matches above, loose matches on Subject: below --
2003-01-16 18:58 Jeroen van Disseldorp
2003-01-17  0:59 ` Adrian Bunk
2003-01-17  3:54   ` Jeroen van Disseldorp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox