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.

When using the IoT-Gateway, please also observe the manual Controllers u-control.
- 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 Filename text box, specify the path to the file that you want to monitor (e. g. /home/admin/user).

External storage devices are accessible at the file path /run/media/sdxn/, where x is the device letter and n is the device specific partition number (e. g. /run/media/sda1 for the first USB flash drive). If there is only one partition, n is missing.
- In the File type drop-down list, select whether you want to monitor a text file or a binary file.

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 Split lines on \n? check box.
- 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.