monitor a folder for file creation, how?

F

fanbanlo

How do I monitor a folder for new file(s) creation?
How to use thread to do a wait until a new file is 'detected'?

Thank you!
 
M

Mike Meyer

fanbanlo said:
How do I monitor a folder for new file(s) creation?
How to use thread to do a wait until a new file is 'detected'?

There's not a clean portable way to do this.

The portable way is to poll the update time of the folder at regular
intervals, and act when it changes. I did that for a Maildir mail
monitoring tool once, but can't seem to find the source now. Sorry.

The clean way depends on your platform. Most modern system have a
mechanism to get the kernel to notify you when a file/directory is
updated. But they are all different. Since you say "folder", I assume
you're on Windows - and I can't help you with this one.

<mike
 

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

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,981
Latest member
satome

Latest Threads

Top