473,382 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

service for file monitoring

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
5 1990
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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Wally | last post by:
Hi Hi need to monitoring my windows service written in VB NET. How can my monitor application "feel" that my service has made something? Is the only way a polling (for example on a Db table)?...
3
by: JSheble | last post by:
I have a windows service that in the OnStart it creates a thread and runs a loop forever and ever, assuming the service is running. The loop stops during the OnStop event, and everything works...
0
by: Seth | last post by:
For some reason my service works fine except that it will create the file in my c drive, but will not write to the file. Sorry if this is a duplicate post, i have found some that ask the same...
3
by: Chris Dunaway | last post by:
I am writing a Windows Service that reads and processes files on a set schedule. I want to create a second app that can monitor the Windows service. The Windows service will write trace messages...
9
by: Rotzooi | last post by:
Hi, I have a VB.NET Service application that's running fine under the Local System account. But for configuration purposes I don't want to be dependent on modifying the registry manually or...
8
by: Rob R. Ainscough | last post by:
I have a VS 2005 Windows Service with a Installer project as part of my solution. The Service installs fine but I can't seem to make either of these work: 1. Have the service start after...
1
by: zdk | last post by:
Now I've critical problem with my system and the limitation of Windows Task Schedule,so I need to code a windows service that can monitoring/watching files in directory if new file or file changed...
0
by: archana | last post by:
Hi all, I want to developed plug-in architecture in windows service. What i want is to develop one windows service which will monitor some folders and as soon as it gets any file on folder it...
9
by: Ryan Liu | last post by:
Hi, I use C# wrote an Client/Server application. In production environment, will be 130 clients (Windows XP) connect to a Server (Windows 2000/2003 Server) thought TCP/IP socket in a local 100M...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.