I have node-red running on a Raspberry Pi that collects some data from sensors.
The Raspberri Pi is connected through an ethernet cable to an intranet where there are other PC's that can access the dashboard for example.
Can I create a flow that creates/writes a text file in a PC that is connected to the intranet to store some data?
I have used the "write file" node to store data into the Raspberri Pi, but I don't know if it's possible to do the same on another device that is connected to the intranet, using the device IP address for example.
The answer somewhat depends on your setup. Is this part of a corporate/company network for example? If so, you need to speak to the IT department before connecting things.
But in principal, you can set up something called SAMBA on the Pi. SAMBA emulates a Windows file and print sharing network on Linux OS's. So the Windows PC's would be able to connect and see the files.
You could, instead use NFS which Windows can also support (I think you have to add one of the Windows extended features though) but its performance is pretty poor.
There are lots of other options too but these are the most obvious.
Your folder/file permissions are wrong. If you are running Node-RED under a specific user/group - which is advised for production use - then you need to make sure that user/group has access to the target folder. The simple way being to add the node-red user to the group permissions for the appropriate folder.