LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete files from multiple paths

Solved!
Go to solution

On my block diagram I have an input path which leads to a case structure that is controlled by radio buttons. The outside case structure will turn to true ater a user selected time period. I am now adding an additional path of images that need to be deleted or moved. 

 

I need to now add the image path to this case structure also but it also needs to go through the same file age parameters from the get file info vi. I have tried using the build array function but it did not work to append the filenames.

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 1 of 7
(2,837 Views)

Option 1: create a subVI with all of the file age logic and then call that subVI for all file paths that need it.

Option 2: Use Build Array and put the file age logic in a FOR loop that will autoindex on the path array


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 7
(2,829 Views)
What would the sub Vi look like?
----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 3 of 7
(2,824 Views)

Basically a List Folder with your FOR loop.  Have an error in and error out and the path input on the connector pane.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(2,817 Views)
How will this work for the output as it links to the case selector after a comparison function on the file age to the system time?
----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 5 of 7
(2,810 Views)
Solution
Accepted by topic author PauldePaor

The comparison is inside of the FOR loop that will be part of the subVI.

 

So your top level VI should look something like this


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(2,799 Views)

Thanks very much for your help crossrulz

The drag and drop of the code snippet isnt working could you please upload it as a Vi?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 7 of 7
(2,792 Views)