Jump to content

VI to recursivly delete a directory


Recommended Posts

Is there a vi that I can use to simply delete a directory and all it contains? (i.e. the equivalent of executing rm -Rf <directory> in *nix)

The only vi I found that can delete directories requires that the directory already be empty. This is bad because it means I have to list all the files in the directory and delete those first. If the directory contains more directories, then it just complicates things. It seems like it would be inefficient to have to write a recursive style vi that repeats this process of going through all the subdirs, deleting each subdirs files, and then deleting the subdir, until the top level directory becomes "empty".

For the measurement system I'm building, I need to be able to delete directories containing millions files as quickly as possible. Any ideas?

Richard

Link to comment
Is there a vi that I can use to simply delete a directory and all it contains?  (i.e. the equivalent of executing rm -Rf <directory> in *nix)

The only vi I found that can delete directories requires that the directory already be empty.  This is bad because it means I have to list all the files in the directory and delete those first.  If the directory contains more directories, then it just complicates things.  It seems like it would be inefficient to have to write a recursive style vi that repeats this process of going through all the subdirs, deleting each subdirs files, and then deleting the subdir, until the top level directory becomes "empty".

For the measurement system I'm building, I need to be able to delete directories containing millions files as quickly as possible.  Any ideas?

Richard

4964[/snapback]

Download OpenG Commander from openg.org and install the file library package. This contains a VI called "Delete Recursive" that does just what its name implies.

Link to comment
Jim,

In laymans terms, that OpenG vi library kicks some serious @!$  (its great!!)  Thanks for introducing me to it.  Is there a version that works with the Linux version of LabVIEW?  Thanks!

Richard

4972[/snapback]

What problems do you have with running this VI on LabVIEW for Linux?? IT should be all native if I'm not mistaken and therefore should work on any LabVIEW platform equally well.

Rolf Kalbermatter

Link to comment
Jim,

In laymans terms, that OpenG vi library kicks some serious @!$  (its great!!)  Thanks for introducing me to it.  Is there a version that works with the Linux version of LabVIEW?  Thanks!

Richard

4972[/snapback]

Richard,

You're very welcome and I hope you enjoy the various other libraries and tools that OpenG developers have created. I'm sure you will find a lot of @!$ kicking stuff in there ;)

Regarding Linux, Rolf is right, both OpenG Commander and nearly all of the downloadable libraries should work on Linux (and Mac, too).

-Jim

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.