With the below flow using executables, I am creating a JSON file in Losant edge agent, and when I try to write data into that file using File Write, it says permission is denied also when I pass ls -lh command to see the file it is not showing up.
When you started up the agent, did you mount the file or its parent directory into the Docker container? That must be done in order to read and write from the agent.
We mention this in our docs for the File: Tail Trigger and also in the GEA usage page; I will file a ticket about getting that added to the Read / Write Node docs as well.
Can you provide the full docker command you are using to start the container, making sure to redact any sensitive info that may be in it such as access keys?
So, Is it possible to read/write in .txt or .json format files using File Read/Write node? because the encoding only supports UTF and when I read it, I get object object in the debug
What’s most likely happening is the file content is getting written as [object Object]. If you have an object on your payload and you are trying to write that object to a file, you need to use the {{jsonEncode}} helper or a JSON: Encode Node to stringify that object before it is provided to the File: Write Node as the contents.
Then, when reading, if you want to operate on the file contents as an object, you’ll need to follow up the File: Read Node with a JSON: Decode Node to parse it.
If this is something you will be doing often across multiple workflows, you may want to consider wrapping all of this in a Custom Node.