I was playing with a flow today to create a simple API for writing data to a CSV file. If it is able to write to the file then I want it to write the data and return a simple success message. If it's not able to write to the file then I wan't to return a simple error message so it can be handled appropriately on the client side.
I've run into two difficulties:
If it write to an invalid location I know will fail, it only generates an error (caught by the Catch node) the first time?
The Write file node always returns the payload (even if it fails) making it much more difficult to handle and create a flow to return the correct success/error message back to the HTTP Response node.
With this * fs-ops-access - Test existence and accessibility of a file or directory Node you can test if you could write a file in your desired location.
Are you using the latest version of node-red? If so then I think item 1 would be a reportable bug.
For item 2 try using a Catch node and a Complete node. If the node behaves in a well behaved way it will output to only one of those, dependent on success or failure. I have not tried it with that node though. Again, make sure you are on the latest node-red.