How to use "Watch" only for .txt and .xml

Hello everyone,
I use the “Watch” command to monitor a directory including its subdirectories.
As soon as it reads data from the subdirectories I get the error message. "Error: EISDIR: illegal operation on a directory, read"

Is there a way to only monitor .xml and .txt files?
BR Perkele

Exactly what Watch command are you using?

As soon as what reads from the subdirectories.

Also please show us the startup log from node-red, that will tell us a lot about your system.

You can simply watch the directory and use a switch node after the watch to filter the .xml and .txt files

chrome_sfDYLUIr4P

Demo flow (use CTRL+I to import it)

[{"id":"6fdfaaf255b50a10","type":"watch","z":"3642c7ee286f9c17","name":"","files":"c:/temp/","recursive":true,"x":1290,"y":260,"wires":[["6072ba90a762695a"]]},{"id":"6072ba90a762695a","type":"switch","z":"3642c7ee286f9c17","name":"","property":"filename","propertyType":"msg","rules":[{"t":"regex","v":"\\.txt$","vt":"str","case":false},{"t":"regex","v":"\\.xml$","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":2,"x":1590,"y":260,"wires":[["e337f5a1709a6001"],["aae583f0053d1803"]]},{"id":"442f6f3a11522f39","type":"inject","z":"3642c7ee286f9c17","name":"filename: test1.txt","props":[{"p":"payload"},{"p":"filename","v":"test1.txt","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1320,"y":20,"wires":[["fb07d3fdd7b9f2ce"]]},{"id":"e9e772d7436bb193","type":"inject","z":"3642c7ee286f9c17","name":"filename: test1.txt.zip","props":[{"p":"payload"},{"p":"filename","v":"test1.txt.zip","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1340,"y":100,"wires":[["fb07d3fdd7b9f2ce"]]},{"id":"4972b130870b365f","type":"inject","z":"3642c7ee286f9c17","name":"filename: test1.pdf","props":[{"p":"payload"},{"p":"filename","v":"test1.pdf","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1330,"y":140,"wires":[["fb07d3fdd7b9f2ce"]]},{"id":"113a52d49a3a6226","type":"inject","z":"3642c7ee286f9c17","name":"filename: test1.xml","props":[{"p":"payload"},{"p":"filename","v":"test1.xml","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1330,"y":180,"wires":[["fb07d3fdd7b9f2ce"]]},{"id":"e337f5a1709a6001","type":"debug","z":"3642c7ee286f9c17","name":"txt files -> ","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"filename","statusType":"msg","x":1740,"y":220,"wires":[]},{"id":"aae583f0053d1803","type":"debug","z":"3642c7ee286f9c17","name":"xml files -> ","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"filename","statusType":"msg","x":1750,"y":300,"wires":[]},{"id":"33beb950e5066b5c","type":"inject","z":"3642c7ee286f9c17","name":"filename: test2.txt","props":[{"p":"payload"},{"p":"filename","v":"test2.txt","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1320,"y":60,"wires":[["fb07d3fdd7b9f2ce"]]},{"id":"13fb944742cce589","type":"inject","z":"3642c7ee286f9c17","name":"filename: test2.xml","props":[{"p":"payload"},{"p":"filename","v":"test2.xml","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1330,"y":220,"wires":[["fb07d3fdd7b9f2ce"]]},{"id":"fb07d3fdd7b9f2ce","type":"junction","z":"3642c7ee286f9c17","x":1500,"y":80,"wires":[["6072ba90a762695a"]]}]