node-red-contrib-fs | Node-Red node template for host filing system | Stream Processing library
kandi X-RAY | node-red-contrib-fs Summary
kandi X-RAY | node-red-contrib-fs Summary
Node-Red node template for host filing system handling
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-red-contrib-fs
node-red-contrib-fs Key Features
Community Discussions
Trending Discussions on node-red-contrib-fs
QUESTION
I am currently working on creating a Dashboard in MS Excel, using Node-RED to get the data from the source system. In order not to have to import all the gathered data all the time, I created a flow that checks for a file (specifically "ImportSuccess.csv") to be existent using "node-red-contrib-fs-ops 1.6.0", specifically fs-ops-access.
If no, then the message will head into a Join-Node and will be appended to an array.
If yes, then the ImportSuccess.csv should be deleted, the message triggering this will get the "msg.complete" attribute and will be passed into the aforementioned Join-Node and trigger it to send out the whole array into a csv-file, overwriting its previous contents. In Excel, I then get the data from that csv-file and create a new "ImportSuccess.csv" to communicate to Node-RED that my tool is ready for a new batch of data.
Following problem occurs: Due to checking for existence and deleting the file being two different steps, a second message can successfully pass through the existence-check which results in double overwriting of the storage csv-file which causes loss of data.
Is there a way to prevent this from happening?
Flow diagram:From my understanding, I need to "force" that the upper branch is fully finished before a next message gets to pass through the "File Access"-Node.
...ANSWER
Answered 2021-Nov-27 at 11:03Found a solution by programming my own function node - ty for checking in
EDIT: How to solve the problem by using a Function Node
Edit Settings.js with fs: require("fs") under functionGlobalContext
Write Function Node as follows:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-red-contrib-fs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page