Raised This Month: $ Target: $400
 0% 

Is there any way to open all files from a folder one by one?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 04-20-2012 , 09:16   Is there any way to open all files from a folder one by one?
Reply With Quote #1

Title says it all...

I have a folder called 'Folder' with 5 files : 1.txt, 2.txt, 3.ini, 4.vault, 5.hi
Is there any way I can detect them and them open them one by one ? (with fopen)
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-20-2012 , 09:42   Re: Is there any way to open all files from a folder one by one?
Reply With Quote #2

Code:
new const dir[] = "addons/amxmodx/configs" new file[32], path[64]; new d = open_dir(dir, file, charsmax(file)); new f do {     // check for '.' and '..' files     if(file[0] == '.' && (!file[0] || file[1] == '.' && !file[2])) {         continue;     }         formatex(path, charsmax(path), "%s/%s", dir, file);         f = fopen(path, "rt");         if(f) {         // read                 fclose(f);     } } while(next_file(d, file, charsmax(file)); close_dir(d);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode