Raghul wrote:
Is it possible to monitor a folder in the python?My question is if I
put any file in it that particular folder my script should monitor the
folder and read the file name.If so what function can I use?

Thanx in advance


If you do not want to poll (check for changes yourself regularly), here are some pointers:

In Windows:

With the win32 extensions, it's quite simple:

http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html

In Linux:

http://www.edoceo.com/creo/inotify/

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

http://www.lambda-computing.com/projects/dnotify/

Don't know of any Python extensions for the above, so you might
have to write your own if you want to use them from Python. Also,
you probably need to reconfigure and compile a new kernel. Have
tested inotify myself and it seems to work, you also get the filename
with the event. Only problem is it don't support monitoring a directory
recursive (subdirectories) like in Windows with ReadDirectoryChangesW.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to