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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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