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.

read_manual

When using the IoT-Gateway, please also observe the manual Controllers u-control.

  1. Open Node-RED.
  2. Add a tail node from the storage category to the workspace.
  3. Double-click the tail node to open the Edit tail node dialogue.
  4. In the Filename text box, specify the path to the file that you want to monitor (e. g. /home/admin/user).
  5. notice

    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.

  6. In the File type drop-down list, select whether you want to monitor a text file or a binary file.
  7. 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.

  8. 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.
  9. Click Done to apply your changes.
  10. Add more nodes to the workspace and connect them to a flow with the tail node being the first node.