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
2 registered members (AndrewAMD, TipmyPip), 12,709 guests, and 5 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
Read data out of folder #299702
11/26/09 08:31
11/26/09 08:31
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Hey guys,

been a while since I asked for help here tongue
But this question I looked for in the manual, but couldn't find anything related...

I wanna read out specific filetype files from a folder, is there a way to store all filenames of them in an array?
(maybe just every file in the folder, then i can seperate out all the specific's I want myself by looking at it's extension).

anyone know's how to, or could write me some code/DLL?

thanks!


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Read data out of folder [Re: Helghast] #299707
11/26/09 08:57
11/26/09 08:57
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
C'mon man...

Check the manual...

txt_for_dir( TEXT*,STRING* name)

:b


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Read data out of folder [Re: EvilSOB] #299717
11/26/09 10:39
11/26/09 10:39
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
HAHAHHAHAAAA, oh, i'm so ashamed xD
I kept on looking for "folder" and "file", but never looked for this...
thanks for pointing that out ^__^

Sometimes you just need a push in the right position, and I couldnt imagine this wouldnt be supported already...

thanks again laugh


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Read data out of folder [Re: Helghast] #299719
11/26/09 10:50
11/26/09 10:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No problems dude. Happens to the best of us...

even me... grin


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Read data out of folder [Re: EvilSOB] #299790
11/27/09 04:10
11/27/09 04:10
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline
Newbie
Sepiantum  Offline
Newbie
S

Joined: Nov 2009
Posts: 34
FILE* file = fopen("c:\\file.txt","r"/*Open params*/);

int data;

fscanf(file,"%d",&data);

fclose(file);

Hope that helps.
use "r" for reading, use "w" for writing, use "a" for appending at the end of file. Although you need to use fprintf instead of fscanf.

Re: Read data out of folder [Re: Sepiantum] #299804
11/27/09 08:22
11/27/09 08:22
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
thanks, though i already figured it out using txt_for_dir.
thanks nonetheless laugh

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Read data out of folder [Re: Helghast] #299805
11/27/09 08:29
11/27/09 08:29
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Keep Sepiantum's suggestion in mind though Helghast.
txt_for_dir is missing some capabilities.

I think it is incapable of listing sub-folders or something like that.
It ONLY will list files, and those files MUST have some extension.
Or something like that....

Damn my long-term memory.



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Read data out of folder [Re: EvilSOB] #299812
11/27/09 09:28
11/27/09 09:28
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: EvilSOB
Keep Sepiantum's suggestion in mind though Helghast.
txt_for_dir is missing some capabilities.

I think it is incapable of listing sub-folders or something like that.
It ONLY will list files, and those files MUST have some extension.
Or something like that....

Damn my long-term memory.


That's fine, all i really want is to read .bmp files out of a single folder (nothing nested or whatever in there).
It's good for future reference, I agree, who knows i might need it later anyway laugh

for now i can load all the strings, and read it out and load them bmp's using pstring, that's all I wanted ^_^

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1