QB64 Phoenix Edition
Get Next Filename into a string (or array) - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3)
+---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7)
+---- Thread: Get Next Filename into a string (or array) (/showthread.php?tid=1508)



Get Next Filename into a string (or array) - GTC - 02-26-2023

I need to open each of the files present in a given folder/directory and process them one by one.

A crude way would be to use DIR to create a text file containing all of the file names, then read that to obtain each of the filenames, line by line.

However, I'm wondering if QB64 has a function to Get Next Filename into a string that can be called in a loop until there are no more files in the directory?


RE: Get Next Filename into a string (or array) - Petr - 02-26-2023

Hi, use direntry.h by Steve for get all files in directory to array. Dir to file returns different results depending on the version used operating system. Direntry.h is here: https://staging.qb64phoenix.com/showthread.php?tid=68


RE: Get Next Filename into a string (or array) - GTC - 02-26-2023

Great. Thanks!