LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete files

Hello,
I would like to know how I could delete files contained in a repertory after 7 days when it was create. I have to enter in the repertory because the VI that I made applies just to the repertory and not so that there is inside. I join my VI.
0 Kudos
Message 1 of 23
(3,857 Views)
One of the easiest ways is to append the save-date to the filename (filexx_120506 or something similar). In your vi you can browse through the entries of your directory and compare the date in the filename with the current date. If the date in the filename is more than 7 days ago, delete it.
 
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 23
(3,850 Views)
Ok, i forgot to say that the names of the files are temp_120506 for example, so i'm on the good way but i don't see how to browse through the entries of my directory after it's easy to compare and delete.
0 Kudos
Message 3 of 23
(3,844 Views)
There's a vi "list folder" somewhere in the file palette. You can use this vi, to retrieve all filenames in a directory.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 23
(3,842 Views)
By the way, i thinked that compare the date and the file name was easy but i don't see how to do, i try but i don't succeed.
0 Kudos
Message 5 of 23
(3,829 Views)

Post what you have done so far. It is better to learn from your mistakes than get a working solution.

If you post your vi, there will be a member who says what is wrong and give you advice for sure.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 23
(3,821 Views)
ok i join my vi.
0 Kudos
Message 7 of 23
(3,812 Views)

[IFK_FIO_Check X Day Old and Delete]

i.e. Filename = temp_135.txt       where, 135 = Day of Year

This utility check if the file is created more than 7 days ago.
If yes, perform file delete(action to be added by you :))

PS:  As of what Becktho mentioned, it is better to learn from your mistakes than get a working solution. So, when you got a working solution, it is better to understand how it works 🙂 Cheers!


LabVIEW 7.1

Solution Prepared By,
Ian Fung, Koo
ian_fung@yahoo.com | Singapore

Message Edited by ian fung on 05-16-2006 12:05 AM

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 8 of 23
(3,813 Views)
I wanted to use the task "delete files" but i have an error who say "the command need a controler GPIB like active controler."
and i don't know what it means and what must i do to have not this error.
0 Kudos
Message 9 of 23
(3,795 Views)

Have you already modified your vi according to the input from ian_fung?

If so, post the new one and we'll have a look at it. In addition - this error message is basically not related to file IO. Is this all that is displayed or is there more? If there is, make a screenshot and post it to.

If you want good answers you should provide as much information as you can.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 10 of 23
(3,791 Views)