Check If file exists - functionGlobalContext

Hey Julian,
the example gave me some inspiration and yeah how easy and confortable it is to import the modules directly in the function node. :wink:

Now I have a solution that works for me :slight_smile:

fs.stat('/home/pi/Test/grab.jpg', function(err) {  
    if (err) {
       msg.payload = 0      // Datei existiert nicht
    } else {
        msg.payload = 1     // Datei existiert bereits
    }
});

return msg;

I need the function to grab a jpg file out of rtsp security cam stream and send via telegram.

thanks for your help :muscle:t2:

1 Like