LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete to recycle bin

Solved!
Go to solution

Within my company we store data in a hierarchy with 4 levels.  In my program I've got buttons to delete any one of the levels.  Today I accidentally deleted the third level when I meant to delete the 4th.  Therefore, lots of other data on the 4th level that I wanted to keep is now lost.  The File I/O palette's Delete doesn't go to the recycle bin, so I can not recover my lost files.  I'd like to avoid this situation in the future, so does anyone know a way to delete to the recycle bin?

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 1 of 5
(4,097 Views)

I know there are Windows API functions for doing this, but I am unaware of a feature in the default palette set to enable moving files to the Recycle Bin.  If I recall correctly, the operation of "deleting to the recycle bin" copies the file(s) to a directory in the root of the drive and may rename the file as well...not too sure, you might try a google search for more info.

 

Also, I recall the OpenG tools had a palette for File I/O, you might check out some of the tools provided with their toolkit to see if they've already done this...

 

This is a great product suggestion and the feature could be implemented, though it probably would be dependent on the OS if the function calls change.

 

-Bob

Message 2 of 5
(4,087 Views)
Solution
Accepted by topic author elset191

I have stripped out the interesting bit from another VI, try this.  I agree that there should be native support for this.

 

A second option is to move the files to a directory inside your LV temp. directory.  There is a path constant for the LV temp. directory, and I think the files are automatically removed at some point.

Message Edited by Darin.K on 12-02-2009 05:28 PM
Message 3 of 5
(4,065 Views)

Darin.K wrote:

I have stripped out the interesting bit from another VI, try this.  I agree that there should be native support for this.


That's great Darin, thanks.  It didn't work for directories, but it was simple enough to choose a different method for the invoke node.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 4 of 5
(4,033 Views)

that is good idea. thanks.

0 Kudos
Message 5 of 5
(2,946 Views)