Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summing file sizes
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01036762
Message ID:
01036770
Views:
7
Whoops...my bad... I see from your other post that you've gotten the right answer now.

Chad

>Thanks but that will skip all the sub-folder files and their sizes.
>
>>Chuck,
>>
>>Try this:
>>
>>SELECT cDir, SUM(nSize) as nDirSize ;
>>	FROM foo ;
>>	WHERE OCCURS('\', cDir) = 2 ;
>>	GROUP BY cDir
>>
>>HTH,
>>Chad
>>
>>>I have a program that goes down the directory structurer getting a list of all the files in the path. What I need now is to be able to sum up the records by a selected depth.
>>>
>>>My data has three fields dir, file, size and looks something like this
>>>
>>>C:\WINDOWS\        CLOCK.AVI          82944
>>>C:\WINDOWS\        COFFEE BEAN.BMP    17062
>>>C:\WINDOWS\TEMP\   0004254.TMP          850
>>>C:\TEST\           VPF600.DLL          5701
>>>
>>>
>>>I can put an index on OCCURS('\', dir) and then do a select to get the unique root folders like
>>>
>>>  SELECT DIST dir FROM ac_files WHERE OCCURS('\', dir) = 2
>>>
>>>But I was looking for a select statement that would also sum up all the files and subfolder files sizes for that directory.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform