Skip to main content
Question

Directory watch file types

  • December 9, 2015
  • 2 replies
  • 26 views

swach
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 31 replies

Is there a way to control which file types directory watch processes? I have a process set up to run xml files triggered through directory watch. Folders containing jpgs are also copied to this directory (I have no control over this). These folders trigger the process then fail. Is there some way to tell directory watch to only process xmls?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • December 10, 2015

Hi

You should analyze the JSON that is generated by the watcher to test for the file type. Here is a sample message:

{
    "ws_topic": "SAMPLE_TOPIC",
    "dirwatch_publisher_path": "c:\\temp\\test.xml",
    "dirwatch_publisher_content": "ENTRY_CREATE c:\\temp\\test.xml",
    "dirwatch_publisher_action": "CREATE",
    "fns_type": "dirwatch_publisher"
}

In other words, you should test that "dirwatch_publisher_content" ends with ".xml" before starting your process.

David


fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • December 28, 2015

@swach, David definitely has the right idea. Speaking of ideas, it would be great if you filed this request in our Ideas database: https://knowledge.safe.com/content/idea/post.html

Then the rest of the community can vote it up. More votes equals more likely to get done. Thanks for getting involved!