Detect File System changes

L

Lukas Meyer

Hello,

I'm trying to detect changes in a directory. E.g if someone crates a
file, i'll execute another function on this file.

I tried to solve this by creating a loop that permanently checks the
contents of this directory with os.listdir() and compares it with the
one before. But this isn't really working properly.

Can anyone give me a hint to get this working?

best regards,

Lukas
 
F

Fuzzyman

The proper way to do this is to use the facilities provided by the
operating system. This means the solution is going to be different for
different platforms. I've *not* done this before - but certainly for
Windows I've seen discussions about this in this group previously.

The win32 extensions expose this capability for windows. I hope this
helps your googling.

All the best,

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
 
N

Noah

In the UNIX world the common tool is FAM -- File Allocation Monitor.
This is a daemon that will report filesystem changes to clients.
There is a Python interface to libfam called "Python FAM" here:
http://python-fam.sourceforge.net/
It looks mature, but I have never used it.

There are also some alternatives to FAM, but I don't remember the names
of them right now.

Yours,
Noah
 
K

Kent Johnson

Lukas said:
Hello,

I'm trying to detect changes in a directory. E.g if someone crates a
file, i'll execute another function on this file.

I tried to solve this by creating a loop that permanently checks the
contents of this directory with os.listdir() and compares it with the
one before. But this isn't really working properly.

Can anyone give me a hint to get this working?

We just had a thread on this topic:
http://groups.google.com/group/comp...33ab/ca7110a9776904eb?rnum=4#ca7110a9776904eb

Kent
 
L

Lukas Meyer

Hello,

Thank you for your assistance. I could manage it using your link to the
already discussed thread.

best regards,

Lukas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top