Check your config file. You should see stuff like this:
# CFC Function for file Change events
# Default is onChange, set to nothing if you don't want to see these events
changeFunction=onChange
# CFC Function for file Add events
# Default is onAdd, set to nothing if you don't want to see these events
addFunction=onAdd
# CFC Function for file Delete events
# Default is onDelete, set to nothing if you don't want to see these events
deleteFunction=onDelete
Maybe yours has the functions messed up. Ie, changeFunction=onDelete
On 10/12/06, George Owns <[EMAIL PROTECTED]> wrote:
> 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:256628
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4