Storage Nodes

Estimated reading time: 4 minutes

The storage nodes provided in OT Link Platform Flows can be used to read a file or write to a file.


Tail Node

This node only works in Linux and Mac operating systems, not in Windows system. It relies on the tall -F command. It tails or "watches" for the things that are required to be added to the configured file.

Tail
[
    {
        "id": "8158ee09.8394",
        "type": "tail",
        "z": "ea431baa.b2d16",
        "name": "",
        "filetype": "text",
        "split": false,
        "filename": "",
        "x": 513.5,
        "y": 185,
        "wires": [
            []
        ]
    }
]


File In Node

File content is read using this node and is sent as msg.payload. The filename is then sent as msg.filename. The filename can be changed in the node. If the filename is not specified it will be set as msg.filename in an incoming message.

File In
[
    {
        "id": "e1c02b69.5a7ff8",
        "type": "file in",
        "z": "ea431baa.b2d16",
        "name": "",
        "filename": "",
        "format": "utf8",
        "x": 530.5,
        "y": 196,
        "wires": [
            []
        ]
    }
]


File or File Out Node

The File or File Out node is generally used to create log files. It writes msg.payload to the file that is specified. The filename can be configured in the node. If the name is left blank, it is required to be configured to msg.payload in the incoming messages. By default, it appends to the file, but can be modified to overwrite the file each time. An example would be a static web page or a complete report.

File
[
    {
        "id": "4f8033a5.4c39cc",
        "type": "file",
        "z": "ea431baa.b2d16",
        "name": "",
        "filename": "",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "false",
        "x": 535.5,
        "y": 212,
        "wires": []
    }
]


FTP In Node

This node will allow you to List, Get, Put, and Delete files on a remote FTP server. The Get and Put operations use msg.filename (the path/name of the file on the remote machine) and msg.localFilename (the path/name of the file on the OT Link Platform system).

The Delete operation only specifies msg.filename (the path/name of the file on the remote machine). The List operation returns an array of the file/folders in the user's default ftp folder, with the standard attributes: type, name, sticky, rights (an object), acl, owner, group, size and date.

[
	{
		"id":"be82074.47a8878",
		"type":"ftp in",
		"z":"e052b363.bcca48",
		"ftp":"a7676b1a.e9714",
		"operation":"list",
		"filename":"",
		"localFilename":"",
		"name":"",
		"x":276,
		"y":68,
		"wires":[]
    }
]