This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

open_dir() + next_file() +? alphabetical.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-19-2009 , 18:45   open_dir() + next_file() +? alphabetical.
Reply With Quote #1

I'm trying to read files in alphabetically but when I use this the files are not alphabetical.

PHP Code:
    new filename[32], len
    
    
new pDir open_dir(szFilepathfilenamecharsmax(filename))
    
    if(
pDir)
    {
        do
        {
            
len strlen(filename)

            if(
len 4)
            {
                if( 
equal(filename[len 4], ".ini") )
                {
                    
// Load file!!!
                    
server_print("Filename: %s"filename)
                    
// server_print(">>>>Yippeeeee!!!!!!!")
                
}
            }
        } while( 
next_file(pDirfilenamecharsmax(filename)) )
        
close_dir(pDir)
    } 
Output:
Code:
test
Filename: maps2.ini
Filename: maps3.ini
Filename: maps4.ini
Filename: maps1.ini
The ultimate goal is to be able to define the order files are read by prefixing the filenames with 1, 2, 3, etc. Like rc#.d folders in linux (I'm using Fedora).
__________________
fysiks is offline
 



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 00:31.


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