Directory Notification in Unix? 
Author Message
 Directory Notification in Unix?

I'm looking for something like Win32::ChangeNotify except that it
needs to run on Solaris. For those who don't know, it notifies you
when something has happened in a particular directory.

I would of thought using IO::Select and IO::Dir would of done the
trick for me but when I call can_read, it returns immediately with no
items.

Here's a sample program...

use IO::Select;
use IO::Dir;

my $dh = new IO::Dir "/tmp/testing";
my $dir_notify = new IO::Select();
$dir_notify->add($dh);



This is using perl5.6.1 and Solaris 2.6

Any suggestions on how to do this would be greatly appreciated.

Thanks,
Cal



Wed, 16 Nov 2005 21:04:53 GMT  
 Directory Notification in Unix?

Quote:

> I'm looking for something like Win32::ChangeNotify except that it
> needs to run on Solaris. For those who don't know, it notifies you
> when something has happened in a particular directory.

> I would of thought using IO::Select and IO::Dir would of done the
> trick for me but when I call can_read, it returns immediately with no
> items.

There is no standard Unix feature for this.

I don't know if there's any Solaris-specific feature.

This is really a Unix question.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Wed, 16 Nov 2005 21:09:07 GMT  
 Directory Notification in Unix?

Quote:

> I'm looking for something like Win32::ChangeNotify except that it
> needs to run on Solaris. For those who don't know, it notifies you
> when something has happened in a particular directory.

> I would of thought using IO::Select and IO::Dir would of done the
> trick for me but when I call can_read, it returns immediately with no
> items.

> Here's a sample program...

> use IO::Select;
> use IO::Dir;

> my $dh = new IO::Dir "/tmp/testing";
> my $dir_notify = new IO::Select();
> $dir_notify->add($dh);



> This is using perl5.6.1 and Solaris 2.6

> Any suggestions on how to do this would be greatly appreciated.

I use Digest::MD5 to create an MD5 checksum of every file in a directory.
I use Storable to store a hash of the file name, file size and checksum to
disk. The following day, I create new checksums and compare them to the
checksums stored from the prior day. If a checksum doesn't match, the file
has changed.

--

Nothing is more despicable than respect based on fear.
- Albert Camus



Thu, 17 Nov 2005 15:14:26 GMT  
 Directory Notification in Unix?

Quote:
>> I'm looking for something like Win32::ChangeNotify except that it
>> needs to run on Solaris. For those who don't know, it notifies you
>> when something has happened in a particular directory.
>There is no standard Unix feature for this.
>This is really a Unix question.

So, may we say that we finally found a win* feature that *nices don't
provide? OK, then one would have to argue wether this is a useful
feature or not... if I understand correctly, this is the kind of
facility exploited e.g. in a file browser to instantly update the
visual representation of a "folder" as files are added/removed/etc.,
isn't it?

Michele
--
$\=q.,.,$_=q.print'  ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr

Quote:
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'

F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;


Sat, 19 Nov 2005 23:05:20 GMT  
 Directory Notification in Unix?

Quote:



>>> I'm looking for something like Win32::ChangeNotify except that it
>>> needs to run on Solaris. For those who don't know, it notifies you
>>> when something has happened in a particular directory.

>>There is no standard Unix feature for this.

>>This is really a Unix question.

> So, may we say that we finally found a win* feature that *nices
> don't provide? OK, then one would have to argue wether this is a
> useful feature or not... if I understand correctly, this is the kind
> of facility exploited e.g. in a file browser to instantly update the
> visual representation of a "folder" as files are added/removed/etc.,
> isn't it?

See the info on FAM:

http://oss.sgi.com/projects/fam/faq.html

There is a Perl interface to it:

http://search.cpan.org/author/JGLICK/SGI-FAM-1.002/lib/SGI/FAM.pm

Ted



Sun, 20 Nov 2005 15:58:44 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. directory entries chopped on SCO Unix

2. Unix perl directory conventions??

3. Reading a NT directory from Unix

4. Problem to read DOS directory from SCO UNIX

5. directory and moving files on unix

6. HOw to check for file existence in each home directory of Unix users

7. Modifying \n\r on a directory tree of html files to \n files for UNIX

8. Modifying \n\r on a directory tree of html files to \n files for UNIX

9. Visual representation of UNIX Directories?

10. UNIX directory permissions in Perl

11. listing directories under multitiple systems (winXX, unix....)

12. Selecting directory under Win32/Unix

 

 
Powered by phpBB® Forum Software