Watch node - add option to wait till file write completion

The watch node may fire multiple times during the writing of a file. This means that it is often (very often in my experience) necessary to follow the watch node with a Trigger to delay the message till the write has finished.
The underlying library (which I believe is chokidar) has an option awaitWriteFinish which is documented as delaying the watch event until a little time after the file stops being written to. It would be useful if the Watch node had an option to enable that in order to avoid the requirement for a Trigger node.
This problem is regularly encountered on the forum, see Using a watch node for example.

Correction: The watch node does not use chokidar, it uses fs.notify

1 Like

Looking forwards to the pull request:-)

Sadly I don't have the time to get into core development at the moment. I presume that is core.

ah well - some other time then.
It is core but uses the fs.notify library so may or may not expose the call you want - if anyone wants to look/have a go.

To close this off for the moment, since it has become clear that the node uses fs.notify, not chokidar, it would likely require a complete rewright. So, unless someone takes this on, we shall have to carry on with what we have. Which works fine, except for the fact that it often needs to be followed by a Trigger node.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.