Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
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
2 registered members (AndrewAMD, Nymphodora), 485 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
Find all Mdls Files in a Folder #441067
05/11/14 10:40
05/11/14 10:40
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline OP
Expert
Puppeteer  Offline OP
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Hi!

I need a list of all mdl files in a folder.
There was once a snippet around that could do just that but I wasn't able to find it.

Thank you
Puppeteer


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: Find all Mdls Files in a Folder [Re: Puppeteer] #441068
05/11/14 10:55
05/11/14 10:55
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Code:
//scan for mdl files
WIN32_FIND_DATA FindFileData;HANDLE hFind;STRING* tmp_str="";
str_cpy(tmp_str,STR_DIR);  //-> set directory (STR_DIR)
str_cat(tmp_str,"\\*.mdl");//Models
hFind=FindFirstFile(_chr(tmp_str),&FindFileData);
if(hFind!=INVALID_HANDLE_VALUE)
{
	int c=0; while(1) 
	{ 
		str_cpy((TEXT_file_list.pstring)[c],_str(FindFileData.cFileName));
		c++;

		if(!FindNextFile(hFind,&FindFileData)){break;}
	} 
}
FindClose(hFind);


Re: Find all Mdls Files in a Folder [Re: oliver2s] #441070
05/11/14 11:46
05/11/14 11:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There is a lite-C function for that, sadly not with the best name and thus hard(er) to find:

http://www.conitec.net/beta/txt_for_dir.htm


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

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

Gamestudio download | chip programmers | 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