Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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