devxlogo

Getting All Files in a Directory

Getting All Files in a Directory

Question:
How do I loop through a window’s subdirectory and get all the files one by one? I need to save each file in a specific format before saving it to a database.

Answer:
The PowerBuilder list box object has functions that will load the contents of a directory into the list box. You can specify whether you want files, directories, or both.

By requesting all directories first, and then files, you can recursively call the function to get all the files in the subdirectories.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist