Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Count more than 65,000 files in directory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00441608
Message ID:
00441723
Vues:
12
>I'm working on a data transfer project where ARC files are expanded into new directories and ADIR() is used to return the file names and file count.
>When there are more than 65,000 files expanded, VFP 6.0 errors with Too many variables. (array limit reached).
>How can I test for the number of files prior to calling ADIR()???
>I considered running DIR * TO FILE (filename) but I figure, the overhead of
>writing a 65,000 line file to disk multiple times, is more than the system will bear.
Another option using Filer.DLL (which is not distributable) is
oFiler = CREATEOBJECT( "Filer.FileUtil" )
WITH oFiler
	.SearchPath = "C:\"
	.FileExpression = "*.*"
	.SubFolder = 1
	.Find(0)
	FOR iFile = 1 TO 50	&& .Files.Count
		WITH .Files.Item(iFile)
			? .Name
			? .Path
			? .Name
		ENDWITH
	NEXT iFile
ENDWITH
I just tested this on my entire C drive and it had no problem with over 42,000 files.
censored.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform