Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing file sizes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01036762
Message ID:
01036763
Vues:
7
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform