02-05-2009 10:49 AM
Hello,
i want to create a vi that can do two things
1. Input: 1. Directory 2. Number
2. Output: newest file in the specified directory
3. Delete all old files if number is two big, so if number = 2 then only keep two newest files in the directory and delete the rest
How can i do this? I cant find andy function to get the date of a file?
Thanks for your help
Solved! Go to Solution.
02-05-2009 11:18 AM
By "date of file" do you mean the date it was created or the date is was modified?
- Matt
02-05-2009 01:14 PM
02-06-2009 01:26 AM
02-06-2009 06:41 AM
Hi
Labview has a function called "File/Directory Info" this will give you the date for last modification. This may not be the same as date created. This function is used in a cool example called "\Listbox for File Explorer Demo.vi" find it with example finder. But as I said the modification data and creation date may not be the same. So I made something using the dir command and system exe function. Much better I think. The dir command is documented here http://www.computerhope.com/dirhlp.htm. The result is in the VI enclosed. You may have to modify it, to fit you need
02-11-2009 04:22 AM
Hi t06afre,
thanks for the great example. Works perfect.