# Creating files on ihost with Node red

**URL:** <https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133>\
**Category:** eWeLink CUBE\
**Created:** [March 4, 2024, 12:01am UTC](https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133 "2024-03-04T00:01:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tl.box.212](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@tl.box.212](https://forum.ewelink.cc/u/tl.box.212)\
**Post date:** [March 4, 2024, 12:01am UTC](https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133/1 "2024-03-04T00:01:03Z")

</div>

Added Node red using the Add-on Guide [https://forum.ewelink.cc/t/add-on-guide-node-red/15505](https://forum.ewelink.cc/t/add-on-guide-node-red/15505). Node red seems to work - I am new to it, but it works for me!

On the left side there are some ‘storage’ nodes - write file, read file, watch.

I am trying to use the ‘write file’ node to write some debug messages to a file - so I can use filebrowser to view the file/data.

The issue is that I can only save files to the ‘/data’ directory, anything else gets a “failed to append to file: Error: EACCES: permission denied, open ‘/data/debug/db3’” - in this case I used filebrowser to create a new directory in /data (which worked) and tried to generate a new file in that directory using Node red (which did not work).

Initially I thought that the issue was with Node red, but it could also be an ihost permissons issue - not sure if its at a user or app level - or something else entirely.

Ideally I would like to write files to a seperate volume, to keep my mess seperate. At the moment everything is going into ‘node-red-files’ (using filebrowser).

Has anyone run into this already? and fixed?

TIA

---

<div class="post-metadata">

**Author:** ![Teki](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/teki/32/1161_2.png) [@Teki](https://forum.ewelink.cc/u/Teki)\
**Post date:** [March 4, 2024, 2:38am UTC](https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133/2 "2024-03-04T02:38:13Z")

</div>

> [@tl.box.212](#):
>
> in this case I used filebrowser to create a new directory in /data (which worked) and tried to generate a new file in that directory using Node red (which did not work).

not clear about your description, the path should be complete.  
in your case for example  
/data/debug/db3/test.txt

---

<div class="post-metadata">

**Author:** ![tl.box.212](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@tl.box.212](https://forum.ewelink.cc/u/tl.box.212)\
**Post date:** [March 4, 2024, 1:23pm UTC](https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133/3 "2024-03-04T13:23:59Z")

</div>

Hi Teki  
I used filebrowser to create a directory and could not create a file in there using Node red.  
Your example had an extra level (db3), so I tried to replicate it. However, rather than use filebrowser to generate the filesystem (/data/debug/db3) and then use Node red to create the file (test.txt), I selected the ‘create directory if it doesn’t exist’ put in the path (/data/debug/db3/test.txt).

It worked fine 😊. So from now on use filebrowser to browse the files, NOT create them. Create directory/files from Node red.  
It must be a permissions thing?

---

<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:05pm UTC](https://forum.ewelink.cc/t/creating-files-on-ihost-with-node-red/29133/4 "2024-10-31T13:05:04Z")

</div>

Was there any progress on this issue because I am also getting a 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:** ![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-on-ihost-with-node-red/29133/5 "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-on-ihost-with-node-red/29133/6 "2024-11-01T01:38:57Z")

</div>

Merged duplicated topics so our dev @SuiKa can take a look
