Can I catch this event?

D

D. Alvarado

Hi,
Basically, I want to run an action every time I detect a new file
appears in a particular directory. I realize I could poll the
directory every 5-10 seconds or so, but I was hoping there was a more
elegant solution. Is it possible to catch the event that a new file
appears or that the size of everything in a directory changes?

I am writing this program with gcc on a Windows platform.

Thanks in advance, Dave
 
T

Thomas Matthews

D. Alvarado said:
Hi,
Basically, I want to run an action every time I detect a new file
appears in a particular directory. I realize I could poll the
directory every 5-10 seconds or so, but I was hoping there was a more
elegant solution. Is it possible to catch the event that a new file
appears or that the size of everything in a directory changes?

I am writing this program with gcc on a Windows platform.

Thanks in advance, Dave

Events, signals* and mutexes are an operating system issue. You
would have better luck asking in a Windows newsgroup.

*Yes, I know the C supports some signals, but in general, it is
the operating system that generates the signals.
 
A

A. Sinan Unur

(e-mail address removed) (D. Alvarado) wrote in
Hi,
Basically, I want to run an action every time I detect a new file
appears in a particular directory. ....
I am writing this program with gcc on a Windows platform.

The solution is platform specific and you'd be better served by posting
the question to one of the comp.os.ms-windows.programmer.* groups.

You can also look up the documentation for FindFirstChangeNotification:

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/fileio/base/findfirstchangenotification.asp

The URL was wrapped in the newsreader, if you have difficulty, use the
following link:

http://tinyurl.com/f6a5
 

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
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top