Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Directory functions - get file list #466918
07/07/17 15:04
07/07/17 15:04
Joined: Jun 2017
Posts: 78
B
BobbyT Offline OP
Junior Member
BobbyT  Offline OP
Junior Member
B

Joined: Jun 2017
Posts: 78
Hello all,

Does Zorro have any directory related functions. I have only been able to find file related functions (defined in stdio.h).

Specifically, I would like to get a list of files in a directory (excluding it's sub-directories) and loop over them and do some stuff.

Is this possible (with native Zorro) or will I have to create a list of synthetic file names and look for them in the directory one by one (using the stdio file file_length() function).

Cheers,
BobbyT

PS: I think dirent.h is what I'm after but it has a lot of dependencies, even in native C. It would be no small feat to port stdio.h over to Zorro (if it's even possible) for someone like myself who is just starting out with 'true' C based languages. A ready implementation would make for an easy life laugh

Re: Directory functions - get file list [Re: BobbyT] #466952
07/10/17 15:29
07/10/17 15:29
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Look into the Windows API. If I remember right the directory functions have names like FindFirstFile, FindNextFile and so on.

Re: Directory functions - get file list [Re: jcl] #466961
07/10/17 17:39
07/10/17 17:39
Joined: Jun 2017
Posts: 78
B
BobbyT Offline OP
Junior Member
BobbyT  Offline OP
Junior Member
B

Joined: Jun 2017
Posts: 78
Thanks JCL. I'll dig into this when I get home today.

I have cooked up an alternative based on synthetic file names but API functions may be a more efficient way to go.

Cheers,
BobbyT


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1