Thanks Greg
You made it a lot clearer now.
----- Original Message -----
From: Greg Luce
To: CF-Talk
Sent: Thursday, November 13, 2003 1:49 PM
Subject: RE: Changes in a Directory CFDIRECTORY
Mickael,
create a table in your db called "Files_Last_Updated" with the
field: dateLastModified
Then at some interval (minute-ly?, hourly, daily) create a scheduled
task to do this:
<cfquery name="get_time" datasource="#my_dsn#">
SELECT datelastmodified
FROM Files_Last_Updated
</cfquery>
<cfdirectory action="" directory ="c:\" name="current_files">
<cfquery name="x" datasource="#my_dsn#" dbtype="query">
SELECT *
FROM current_files
WHERE datelastmodified > #get_time.datelastmodified#
</cfquery>
<cfif x.recordcount GT 0>
<cfmail query="x" to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]"
subject="New Files">
Something about the new files here...
</cfmail>
</cfif>
<cfquery name="update_time" datasource="#my_dsn#">
UPDATE Files_Last_Updated
SET datelastmodified = #createodbcdatetime(now())#
</cfquery>
What'd I forget?
-----Original Message-----
From: Mickael [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 12:37 PM
To: CF-Talk
Subject: Re: Changes in a Directory CFDIRECTORY
Sorry if this is a basic question. How do you store the contents of
CFDirectory?
----- Original Message -----
From: Thomas Chiverton
To: CF-Talk
Sent: Thursday, November 13, 2003 12:04 PM
Subject: Re: Changes in a Directory CFDIRECTORY
On Thursday 13 Nov 2003 16:56 pm, Mickael wrote:
> I have a directory where files are getting uploaded (not via CF). I
know
> how to get the contents of the directory with CFDIRECTORY how would
I get
> changes to the directory? I would like to send an email out to a
certain a
> group of people when ever a new file is uploaded.
ummm... easy... ?
store the last dir listing you saw in a persistant store.
for each item in current dir listing, add to notify_list if not in
last dir
listing.
update stored dir listing with current
--
Tom Chiverton
Advanced ColdFusion Programmer
Tel: +44(0)1749 834997
email: [EMAIL PROTECTED]
BlueFinger Limited
Underwood Business Park
Wookey Hole Road, WELLS. BA5 1AF
Tel: +44 (0)1749 834900
Fax: +44 (0)1749 834901
web: www.bluefinger.com
Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple
Quay, BRISTOL. BS1 6EG.
*** This E-mail contains confidential information for the addressee
only. If you are not the intended recipient, please notify us
immediately. You should not use, disclose, distribute or copy this
communication if received in error. No binding contract will result
from
this e-mail until such time as a written document is signed on behalf
of
the company. BlueFinger Limited cannot accept responsibility for the
completeness or accuracy of this message as it has been transmitted
over
public networks.***
_____
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Changes in a Directory CFDIRECTORY Mickael
- Re: Changes in a Directory CFDIRECTORY Thomas Chiverton
- Re: Changes in a Directory CFDIRECTORY Mickael
- RE: Changes in a Directory CFDIRECTORY Raymond Camden
- RE: Changes in a Directory CFDIRECTORY Bushy
- RE: Changes in a Directory CFDIREC... Jochem van Dieten
- RE: Changes in a Directory CFDIRECTORY Greg Luce
- Re: Changes in a Directory CFDIRECTORY Jochem van Dieten
- RE: Changes in a Directory CFDIRECTORY Schuster, Steven
- RE: Changes in a Directory CFDIRECTORY Schuster, Steven
- RE: Changes in a Directory CFDIRECTORY d.a.collie
- RE: Changes in a Directory CFDIRECTORY Tangorre, Michael
- RE: Changes in a Directory CFDIRECTORY Pascal Peters
- RE: Changes in a Directory CFDIRECTORY Pascal Peters