Dan - good catch. I read in his email that he "edited" the file - but
looking again it definitely looks like he renamed it.

On 10/13/06, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote:
> George,
>
> This is purely a guess--but I'm guessing the DirectoryWatcher gateway
> doesn't understand the concept of renaming a file.
>
> Try creating a text file, then modify the text file by appending some new
> text.
>
> Does the onChange event run then?
>
> -Dan
>
> >-----Original Message-----
> >From: George Owns [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, October 12, 2006 4:47 PM
> >To: CF-Talk
> >Subject: Directory Watcher
> >
> >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:256646
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