Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR() Mixed case please...
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00436894
Message ID:
00437301
Views:
20
>>>ADIR() returns an array with the files in a directory, but all the filenames are uppercase. Is it possible to get an list of the files in a directory as they are shown in windows explorer (MixedCase)????

If filtering is essenstial, then you could use Filer.DLL (not distributable) - I do not know what the maximum number of files is, but masks can be specified in addition to three search strings, sub-folders, ignore case, etc.
#define FILE_ATTRIBUTE_DIRECTORY            0x00000010  

LPARAMETERS cFileSpec

oFiler = CREATEOBJECT( "Filer.FileUtil" )

WITH oFiler
	.SearchPath = JUSTPATH( cFileSpec )
	.FileExpression = "*.*"
	.Find( 0 )	&& Search, discarding last collection.
	FOR iFile = 1 TO .Files.Count
		IF .Files.Item(iFile).Attr = FILE_ATTRIBUTE_DIRECTORY ;
			OR .Files.Item(iFile).Name == "." ;
			OR .Files.Item(iFile).Name == ".."
			? " DIR "
		ELSE
			? "     "
		ENDIF
		?? .Files.Item(iFile).Name
	NEXT iFile
ENDWITH
censored.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform