02-22-2016 02:26 PM
I do not know if this is a bug, or it should behave like this.
Scenario: create a snippet using the LAVA tool. I just used the same name (and path) of an existing png file which was created a few days before also by the same LAVA tool (so I overwrote the original file). I opened the folder, and in order to find quickly the newly created snippet, I ordered the files as descending by time and date. For my surprise I could not find the snippet at the top. The reason was that, the new file kept the date/time of the original one.
This is just a really minor thing, but it made me curious. In windows, when I rename a file, it keeps the original time stamp. However when I overwrite it, it updates it.
LabVIEW 2015 (32bit),
Code Capture Tool v3.2.1-46 by LAVA
Solved! Go to Solution.
02-22-2016 02:41 PM
I assume you mean the CCT (both from context and from your last line). I haven't looked at that code in a long time, but I'm pretty sure it simply calls the built in Save to PNG VI (which itself probably calls a function in the LVPNG DLL, but I believe it's password protected). It's easy enough to check. The easiest way is to open the CCT and then press Ctrl+. to abort it.
I'm assuming that this will behave the same if you use the VI directly and probably with other saving methods too.
The most likely thing which I can think of is that you're looking at the creation date and you expect to be looking at the modification date.
02-22-2016 02:48 PM
Yep, i am talking about the CCT. Ok, i guess then the CCT modifies only the existing file, and not overwriting it...hmm, still not totally clear 🙂 If i overwrite for example a vi manually, it updates the creation date and time in windows...
02-22-2016 03:05 PM
Like I said, look at the CCT code. The only thing I can think of which would make this interesting is the snippet, which is a stream inside the PNG file, something which the shipping VI does not support. I don't remember how this is done exactly - it might be created as part of the PNG in memory and then written to the file directly or might be injected into the file after the shipping VI saves it.
Incidentally, I just did a quick test in Notepad and if I do save as and tell it to overwrite an existing file, the creation date of that file does not seem to change so this seems like normal behavior for Windows. I don't know if the Windows file API deletes the file and creates a new one or just modifies the existing file when you do this.