Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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