Hi azadi i wrote the code, but its not working. below is the
code for cofig file and the component file.
Config.ini
# The directory you want to watch. If you are entering a
Windows path
# either use forward slashes (C:/mydir) or escape the back
slashes (C:\\mydir).
directory=C:/CFusionMX7/Mail/Undelivr
# Should we watch the directory and all subdirectories too
# Default is no. Set to 'yes' to do the recursion.
recurse=no
# The interval between checks, in miliseconds
# Default is 60 seconds
interval=6000
# The comma separated list of extensions to match.
# Default is * - all files
extensions=*
# CFC Function for file Change events
# Default is onChange, set to nothing if you don't want to
see these events
changeFunction=
# 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=
Component: watcher.cfc
<cfcomponent>
<cffunction name="onAdd">
<cfargument name="cfevent">
<cfset var myfile = arguments.cfevent.data.filename>
<cfset var newdest = getDirectoryFromPath(myfile)>
<!--- copy to ready --->
<!--- newdest is the same path as spool, so 'cheat' and
switch to ready --->
<cfset newdest = replace(newdest, "/Undelivr",
"/spool")>
<cffile action="move" source="#myfile#"
destination="#newdest#/#getFileFromPath(myfile)#">
<cflog file="dirwatcher" text="Moved to
#newdest#/#getFileFromPath(myfile)#">
</cffunction>
</cfcomponent>
Please provide support for the same.
Thanks,
Sachin