07-16-2014 09:33 AM
I have a sub vi (attached) which I runs after a time period checks files and comapres them against a time constraint. If that time constraint is met the the files are either deleted or moved. My current setup uses the file/directory info vi to check the folder path. I want to delete or copy the files after a time period. Given the last modification output on the file/directory info this only checks the last modified date of the folder and I want it to check the files in the folder. How would I do this?
Solved! Go to Solution.
07-16-2014 09:54 AM
07-16-2014 09:59 AM
Hi GerdW,
Thanks for the reply, I need to specify the folder because I want the application to delete the contents of the folder that are older than a time period
07-16-2014 09:59 AM
07-16-2014 10:02 AM - edited 07-16-2014 10:06 AM
The ListFolder function lists out all the files as expected.
I can get all the timestamps out given the attached method but how do I work that into my code?
07-16-2014 10:09 AM
07-16-2014 11:30 AM
Hi Paul,
now I took a look into your VI:
You already know how to create a full path of those files using BuildPath in the inner case structure.
You just need to do the same when you want to check the mod date of your file (instead of the folder path)…
10-23-2015 03:59 PM - edited 10-23-2015 04:04 PM
I'm trying to do a same thing.
Did you ever find a solution to this?
Looks like the method for your if statement is working correctly. But you're using the same path into your case structure. That includes every file in that directory. Not only the old ones.
Somehow you need to SELECT the old files based on last modification date.
I was thinking about opening a cmd window and performing the task outside of labview! Basically write the file names to a text file and read from that to select your old files. Any better ideas using labview functions?
10-23-2015 04:10 PM - edited 10-23-2015 04:14 PM
Hi CAEHP
I did eventually get it working. I have attached the entire finished program. Feel free to use it and change it around to suit your needs. The finished application will only delete or move the files in the specified folder(s) older than the set time. You can also set how often you want the application to check the folder(s).
Hope this helps
05-09-2019 07:25 AM
Hi Paul,
I think I could use this application for my interest but one of the subvi is missing, named File Time Date?
Can you please add that to the zip folder if possible? Thanks
Jatin