Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Directory Watcher

New Here ,
Nov 08, 2008 Nov 08, 2008
I am looking for a CFC to work with the Directory Watcher event gateway of Coldfusion. When a file is detected as being written to a Directory I would like the content of same to be appended to another (master) file that is located elsewhere on the server. I have been seeking an informationa resource on these methods but have been unsuccessful to date. Any guidance would be appreciated.

BTW, I do have the DirectoryWather gateway up and running.
TOPICS
Event gateways
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2008 Nov 11, 2008
LATEST
In the onAdd method, get Coldfusion to read the file and then append it.

<cffunction name="onAdd" output="no">
<cfargument name="CFEvent" type="struct" required="yes">
<cfset data=CFEvent.data>
<cfset addedFile=data.filename>
<cffile action = "read" file = "{absolute_path_to_watcher_dir}\#addedFile#" variable = "textToAdd">
<cffile action = "append" file = "{absolute_path_to_some_other_dir}\someFile.txt" attributes = "normal" output = "#textToAdd#">
</cffunction>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources