422,946 Members | 1,114 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,946 IT Pros & Developers. It's quick & easy.

service for file monitoring

P: n/a
hi,
i am designing a desktop search engine using python.
i am having a query , is there a package available that contains
functions for retrieving the files being edited , created,deleted in
the file system.

thanks

Apr 20 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
En Fri, 20 Apr 2007 17:06:51 -0300, rohit <ro***********@gmail.com>
escribió:
i am designing a desktop search engine using python.
i am having a query , is there a package available that contains
functions for retrieving the files being edited , created,deleted in
the file system.
For windows you can use the techniques described here:
http://tgolden.sc.sabren.com/python/...r_changes.html

--
Gabriel Genellina
Apr 20 '07 #2

P: n/a
On Apr 21, 1:36 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
En Fri, 20 Apr 2007 17:06:51 -0300, rohit <rohitsethi...@gmail.com>
escribió:
For windows you can use the techniques described here:http://tgolden.sc.sabren.com/python/...h_directory_fo...

--
Gabriel Genellina
hi,
well i tried reading that but that way i'll have to make the program
monitor each and every directory.
when a file is created or deleted or filename modified , a call must
be made to the os kernel .
isn't there any way i can utilize that with any api or package
functions so that i can monitor the whole filesystem but at lesser
expense of cpu n memory

regards

Apr 20 '07 #3

P: n/a

Hi,

On Apr/20/2007, Gabriel Genellina wrote:
En Fri, 20 Apr 2007 17:06:51 -0300, rohit <ro***********@gmail.com>
escribió:
i am designing a desktop search engine using python.
i am having a query , is there a package available that contains
functions for retrieving the files being edited , created,deleted in
the file system.

For windows you can use the techniques described here:
http://tgolden.sc.sabren.com/python/...r_changes.html
for linux, python-pyinotify. works very well!

--
Carles Pina i Estany GPG id: 0x8CBDAE64
http://pinux.info Manresa - Barcelona
Apr 20 '07 #4

P: n/a
well i tried reading that but that way i'll have to make the program
monitor each and every directory.
when a file is created or deleted or filename modified , a call must
be made to the os kernel .
isn't there any way i can utilize that with any api or package
functions so that i can monitor the whole filesystem but at lesser
expense of cpu n memory
On Windows W2k+, you can use the USN journal:

http://msdn2.microsoft.com/en-us/library/aa364586.aspx

You may have to use ctypes or write an extension module to access that
journal.

Regards,
Martin
Apr 21 '07 #5

P: n/a
use WMI event monitoring objWMIService.ExecNotificationQuery

http://msdn2.microsoft.com/en-us/library/aa393864.aspx

, then pass the event and the file starting the event to your
application via the command line, what I tend to do (so I keep one
monitor running that starts applications at event occurrence)

drawback but also a strength, the application cannot know for sure
that the event has actually happened - this is a possible strength
because then you can have other applications that redefine the
occasion of the event on a file just by starting your application for
handling that event and passing it a file asserted as having been the
object receiving the event (probably too loosely coupled for lots of
people or scenarios though, if this can be a security problem for your
application have to protect against it etc. )

if you absolutely need monitoring and application tightly coupled then
use Python and WMI to do it, using the same method.

http://tgolden.sc.sabren.com/python/wmi.html
Cheers,
Bryan Rasmussen

On 4/21/07, "Martin v. Löwis" <ma****@v.loewis.dewrote:
well i tried reading that but that way i'll have to make the program
monitor each and every directory.
when a file is created or deleted or filename modified , a call must
be made to the os kernel .
isn't there any way i can utilize that with any api or package
functions so that i can monitor the whole filesystem but at lesser
expense of cpu n memory

On Windows W2k+, you can use the USN journal:

http://msdn2.microsoft.com/en-us/library/aa364586.aspx

You may have to use ctypes or write an extension module to access that
journal.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Apr 22 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.