Outputting file changes using a tail node
You can monitor files for changes. Whenever a monitored file changes, a message containing the changes is injected into the flow.
- Open Node-RED.
- Add a tail node from the storage category to the workspace.
- Double-click the tail node to open the Edit tail node dialogue.
- In the text box Filename, specify the path to the file that you want to monitor (e. g. /home/admin/user).
NOTICE

The memory card is accessible at the file path /run/media/mmcblk0p1/.
- In the drop-down list File type, select whether you want to monitor a text file or a binary file.
NOTICE

The output of a tail node depends on the type of file. Changes to a text file are output as strings. Changes to a binary file are output as buffer objects.
- If you are monitoring a text file and want to replace \n by line breaks in the output , enable the check box Split lines on \n?.
- Click Done to apply your changes.
- Add more nodes to the workspace and connect them to a flow with the tail node being the first node.