Hi there,

so I'm trying to figuring out the Coldfusion Event Gateway by now.

I've set up a really basic example. The cfc looks like this:

<cfcomponent>
<cffunction name="onAdd" output="no">
   <cfargument name="CFEvent" type="struct" required="yes">
   <cfset data=CFEvent.data>
     <cffile action="read" file="C:\Apache\Apache2\htdocs\gateway\log.txt" 
variable="logFile">
     <cfset logFile = logFile & 'ADDED FILE:#data.filename# ON #now()#'> 
     <cffile action="write" file="C:\Apache\Apache2\htdocs\gateway\log.txt" 
output="#logFile#">
     
</cffunction>

<cffunction name="onDelete" output="no">
  <cfargument name="CFEvent" type="struct" required="yes">
  <cfset data=CFEvent.data>
     <cffile action="read" file="C:\Apache\Apache2\htdocs\gateway\log.txt" 
variable="logFile">
     <cfset logFile = logFile & 'DELETED FILE:#data.filename# ON #now()#'> 
     <cffile action="write" file="C:\Apache\Apache2\htdocs\gateway\log.txt" 
output="#logFile#">
</cffunction>

<cffunction name="onChange" output="no">
  <cfargument name="CFEvent" type="struct" required="yes">
  <cfset data=CFEvent.data>
     <cffile action="read" file="C:\Apache\Apache2\htdocs\gateway\log.txt" 
variable="logFile">
     <cfset logFile = logFile & 'CHANGED FILE:#data.filename# ON #now()#'> 
     <cffile action="write" file="C:\Apache\Apache2\htdocs\gateway\log.txt" 
output="#logFile#">
</cffunction>
</cfcomponent>

My problem is that if I edit a file in the folder, instead of:

CHANGED FILE:01_424lo.jpg ON {ts '2006-10-12 22:34:34'}

the log.txt looks like this:

DELETED FILE:01_424lo.jpg ON {ts '2006-10-12 22:36:11'}
ADDED FILE:Guelcan_LoveParade.jpg ON {ts '2006-10-12 22:36:11'}

Can anybody help me?

                
---------------------------------
Was ist Glück? Schlafen Fische überhaupt? Die Antworten gibt’s auf Yahoo! 
Clever.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256586
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to