read files from directory

Deyhim
Deyhim used Ask the Experts™
on
Hi,
I wondering if I can read or calculate number of files in directory using powerbuilder, Actually i cant use DirList function  because it need datalist control which i dont have it.

I want simply to create function to calculate number of files in directory ..  for example function name is files_num.

files_num('C:/test/*.txt') .. this function will return number of text files in 'C:/test' ..

there is any way to do this using powerbuilder 10.5?

thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,

The solution mentioned in the below link gives u more details.
Names of files inside folder and/or subfolders.
You can use it or simply do an Upperbound on the array returned to get a count of number of files.

http://www.tek-tips.com/faqs.cfm?fid=6931

Cheers,
Rosh

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial