Thanks Ben, but not sure I'm fully understanding. My purpose is to listen
for email text files created by a legacy system in a directory. As soon as
one appears, I want the Delphi exe to read in the file, create a new email
in Outlook and send it out. Both the email directory and the Delphi exe,
will be on servers, though not the same server. For the Delphi exe, I will
arrange for it to be run on bootup.

I've found numerous freeware components, even one for Delphi 6, which use
FindCloseChangeNotification and will do the job for me. Because this is
email, I don't want to only poll e.g. every 5 minutes. I'd like instant
response so one of these downloadable components seems a good idea. But if
you could explain the downside some more, it would help.

Thanks.

Dave



-----Original Message-----
From: Ben Taylor [mailto:[EMAIL PROTECTED]]
Sent: 14 August, YYYY 10:30
To: Multiple recipients of list delphi
Subject: Re: [DUG]: How do I create a passive listner in Delphi?


Hi,

couple of thoughts.. 

unless you are doing something odd, the cpu hit of periodically listing
a dir is negligible. implementing a poll is simple, and pretty much
guaranteed to work under any circumstance.

whereas, setting up notification is more complex. your app has no way
of knowing if windows has decided to stop notifying you of events,
unless you eg include code to warn if 30mins have passed with no
updates (not nice).

example of where this has hit me before, i've had a situation where the
directory being monitored was on a network drive. that remote pc
crashed/reset, and notification stopped without error. had this used a
polling system, everything would have continued as normal when the
networked pc came back..

so..
1) keep things as simple as possible
2) this includes trying to keep everything native to delphi

hope that helps :-)

cya!

--- [EMAIL PROTECTED] wrote:
> Hi,
> 
> I'm wanting to have Delphi passively listen for a change in a windows
> folder
> / directory i.e. when a file suddenly appears in the directory,
> having been
> created by another application, this wakes Delphi up.
> 

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to