LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the last modified time of a file?

Does anyone know how to use LabVIEW to check the "last modified time" of a file?
 
Thanks.
0 Kudos
Message 1 of 11
(10,498 Views)
Look for "File/Directory info" in the advanced file I/O palette. One of the outputs is "last mod". 🙂
Message 2 of 11
(10,501 Views)
Thanks for your help. Now I can get the last modified day from the function of "File/Directory Info".
The output of the last modify is a combination of time and date. Do you know how to separate it into two different strings (one for time and one for date)?
 
0 Kudos
Message 3 of 11
(10,487 Views)

It is usually better to at least try finding the answer yourself before posting. Using the LV help and the palette search feature is easy.

If you will go into either the string palette or the time & dialog palette you will find a VI called Format Date/Time String, which can help you.

Also, in the time palette, you can find another VI which will do exactly what you want.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).

___________________
Try to take over the world!
Message 4 of 11
(10,483 Views)
I can find it now. Thanks
0 Kudos
Message 5 of 11
(10,479 Views)
When I use the this function to get the last modified time, I don't get the last modified time, but I get the created time. Does anyone know how to fix or get aroud this?
0 Kudos
Message 6 of 11
(10,254 Views)
This works just fine here (Windows XP, LabVIEW 8.5.1).
 
 
(Actually, if you look closely, it is off by one second. I guess the file properties dialog rounds in a different way :D)
 
 
Do you have more information? (e.g LabVIEW version, OS, etc.). Can you show us the code that fails?


Message Edited by altenbach on 06-27-2008 08:48 AM
0 Kudos
Message 7 of 11
(10,243 Views)
Hi,
 
I have Labview 8.5, Windows XP (what other information do you need?)
There is no error, it appears to function properly, but does not give the proper time.
As you can see, my created time is later than my modified time (because I copied my data). However, if I use a file where my created time lies before my last modified time, I get the same result.
 
Thanks
0 Kudos
Message 8 of 11
(10,206 Views)
Blabara,

Could you post your VI that you are using that is getting you these results?  It does seem a bit fishy.  I am assuming this is happening with different file types as well (not just .txt)?
Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 9 of 11
(10,172 Views)
Hi Jared,

when simplifying my VI to send it to you, I found my mistake. I actually does work. Sorry! (I wired the file info to the folder, in stead od the files in the folder)

Blabara
0 Kudos
Message 10 of 11
(10,139 Views)