Hi, I'm running Node-RED on Windows and using the "exec" node with the following command to get .jpg file modification details:
stat -c "%z %s %n" --
Here's the issue I'm facing:
In the first iteration, I modify one .jpg file using Microsoft Paint, save it, and then run the command. The output from the exec node correctly shows the updated timestamp, which matches the file’s "Date Modified" in Windows file properties.
In the second iteration, I modify a different.jpg file and run the command again. The output now shows the correct updated timestamp for the newly modified file — but strangely, the timestamp for the first file also changes, even though I didn’t modify it.
What’s more unusual is that the first file’s new timestamp is about 2 seconds earlier than the second (actually modified) file.
This new timestamp for the first file does not match what's shown in Windows file properties (it still shows the original modification time there).
ok let me try to answer this... as per my understanding node red is running on a container management system on local machine called "rancher desktop" & infact rancher desktop is running on WSL container in window OS.
The "rancher desktop" is a container manager that runs on a host OS. Node-RED is a node.js app (code that is executed by the node.js application) which requires an OS to run under. WSL is a Linux environment that runs under a Windows OS.
Host OS (Windows?) - Is Node-RED/node.js running here?
--> Rancher Desktop (container manager)
--> Containerised OS (Windows?) - Or is Node-RED/node.js running here?
--> WSL (lightweight Linux container) - or is Node-RED running here?
In addition to knowing where Node-RED is running, which OS (the host, the container or WSL) is hosting the image files?
If at all possible, please try to simplify your architecture because you have at least 1 or 2 too many layers which is making things far too complex and is most likely the root cause of your issues.
Almost certainly not really a Node-RED issue by the way.
By the way, we've not even got into better ways to get the file info. Node.js has its own libraries which will likely be a lot more effective. They can be used with a function node.
But until we know how your setup is actually structured, we still can't really help.