I download a snap shot of a camera that sometime does not succeed
This can be easily checked from filesize (ie: filesize very small = wrong file) and I wanted to use this to filter wrong files for further processing.
I tried to use the "watch" node, but I'm not sure why, sometimes it will not send the "msg.size"
to be clear, sometime it will output:
payload: "/tmp/snap5.jpg" topic: "/tmp/snap5.jpg" file: "snap5.jpg" filename: "/tmp/snap5.jpg" size: 0 type: "file"
payload: "/tmp/snap6.jpg" topic: "/tmp/snap6.jpg" file: "snap6.jpg" filename: "/tmp/snap6.jpg" type: "none"
msg.type is different and size is here or not, no idea why.
I do not delete file, just overwrite with a different file to check what it detects.
Is this expected behavior of watch node ?
Is there an other way, like a simple function command I could use to read a file size ?