LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

folder size

Does anyone have a vi to show folder size in windows?? Inside windows explorer, when you right click on a folder and go to properties, it shows the size of the folder. I want to get that number inside labview.
Message 1 of 10
(7,598 Views)


@unclebump wrote:
Does anyone have a vi to show folder size in windows?? Inside windows explorer, when you right click on a folder and go to properties, it shows the size of the folder. I want to get that number inside labview.



There is a function available in LabVIEW for getting the folder or file size.
All Functions -> File I/O -> Advanced File Functions -> File/Directory Info

You can get more information on this function by using the context help (press CRTL-H and move the cursor over the functions).

CS
0 Kudos
Message 2 of 10
(7,587 Views)
I tried that one, but it returns the number of files in a directory, not the disk size. I found a dirsize.dll on the web, but I don't know how to implement it.
0 Kudos
Message 3 of 10
(7,580 Views)
Might be easier to just get a list of all the files in the directory, get the size of each file and add them all up. You could do that with no dlls.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 4 of 10
(7,568 Views)
In the most general case, your folder might contain other folders with files, so it can get a bit complicated to get the total size this way. The OpenG toolkit has a "List directory Recursive" that might help you with this task. 🙂
Message 5 of 10
(7,562 Views)
OK, I'm so slow typing that I'll erase my mention of OpenG's recursive List directory, but will mention an alternative source on the LAVA forum:
http://forums.lavausergroup.org/index.php?showtopic=170
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 6 of 10
(7,554 Views)
Thanks a bunch. You guys are awesome. I'd give you all ten stars if I could. I followed the LAVA route and modified a vi made by Rolf. You can use this vi to sort your whole hard drive and find the largest files.
Message 7 of 10
(7,534 Views)
I modified the vi to use queues instead of the build array functions.
Message 8 of 10
(7,498 Views)
Hi Unclebump,
 
I have used both the VIs you have supplied. I observed that only the number of files list for the selected directory is indicated differnently. This number in Dan_Armstrong_List_Directory_Recursively_2.vi is showing one more than that indicated in Dan_Armstrong_List_Directory_Recursively_with_queue only.vi.
 
Kindly clarify me regarding this.
 
regards,
Ramkumar. D
 
Thanks,
Ramkumar.D
QuEST, INDIA.
0 Kudos
Message 9 of 10
(7,383 Views)
Dan_Armstrong_List_Directory_Recursively_with_queue only.vi matches what you see when you right click on a folder and select properties inside windows explorer. I added a -1 inside the while loop.
Message 10 of 10
(7,360 Views)