# Creating files and writing to file from Node-Red

**URL:** <https://forum.ewelink.cc/t/creating-files-and-writing-to-file-from-node-red/81796>\
**Category:** eWeLink CUBE\
**Tags:** node-red\
**Created:** [October 31, 2024, 1:20pm UTC](https://forum.ewelink.cc/t/creating-files-and-writing-to-file-from-node-red/81796 "2024-10-31T13:20:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johann.datacare](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@johann.datacare](https://forum.ewelink.cc/u/johann.datacare)\
**Post date:** [October 31, 2024, 1:20pm UTC](https://forum.ewelink.cc/t/creating-files-and-writing-to-file-from-node-red/81796/1 "2024-10-31T13:20:21Z")

</div>

I am having a problem , permissions error when I try and create a file from node-red in iHost, where can I have a sample or better directions how to use “File” in Node-Red on iHost and what is the path and directory where you should create a json file for logging purposes, how do you address a new volume you created and create a file and then write to the file.

---

<div class="post-metadata">

**Author:** ![ward](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/ward/32/10437_2.png) [@ward](https://forum.ewelink.cc/u/ward)\
**Post date:** [November 1, 2024, 1:38am UTC](https://forum.ewelink.cc/t/creating-files-and-writing-to-file-from-node-red/81796/3 "2024-11-01T01:38:06Z")

</div>

Split this topic on November 1, 2024, 1:38am UTC

A post was merged into an existing topic: [Creating files on ihost with Node red](https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133)

---

<div class="post-metadata">

**Author:** ![csongor.varga](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@csongor.varga](https://forum.ewelink.cc/u/csongor.varga)\
**Post date:** [November 20, 2024, 9:31am UTC](https://forum.ewelink.cc/t/creating-files-and-writing-to-file-from-node-red/81796/4 "2024-11-20T09:31:01Z")

</div>

Yes, this is a good question and I would also like to know this.  
I am specifically interested in how to populate the path in the file-out node, so I can create a file in the node-red filesystem in the docker image. What is the path to the node-red installation folder?

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [November 20, 2024, 1:12pm UTC](https://forum.ewelink.cc/t/creating-files-and-writing-to-file-from-node-red/81796/5 "2024-11-20T13:12:44Z")

</div>

I read a post by one of the creators of Node-Red that to set the file path in Docker - always start with `/data` , otherwise it defaults to the working directory of the Node-RED process.  
So in Filebrowser I set the volume to `/srv/data` and ran the Node-Red plugin and set also to `/data`.  
After enabling context memory I use the file path `/data/context/myfolder/` and I write constantly weather information and energy consumption to .csv files. Also it served as a path for saving a proxy, the cookie used by the Alexa node.

BTW @csongor.varga , this is thanks to _your_ “auto logging” flow! 👍 - I run this in my version of that flow.
