while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
While doing next_file
I am getting two file with name "." and ".." How I can do the setting so that I will not get those ? i m doing like Code:
while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) )) |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
Just add a check.
if( s_Buffer[ 0 ] == "." ) { continue; } |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
I did but the problem is ....
I need next file of a particular file . For example if I have 001.dll 002.dll 003.dll Then i have put condition like Code:
while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))Now as I am doing continue it is again calculating the next file and I am getting only one file each time . The next file of ".." So how to overcome it . I hope you got my problem |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
or more clear idea what I am trying to do ...
I am storing a filename is a config file . The file will only hold one line which is the last used filename . So that we can easily calculate the next file . And we are calculating the next file at each map change . So it's like 1) Retriving the old file name from the config file 2) take the next file 3)delete the old entry from the config file 4) put the new entry |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
There is no reason to open the directory when you know exactly what is in the directory. Especially if you number your files like you do above. Just add one to that digit. If you go over the maximum then go back to 001.
You are making it way harder than it needs to be. Also, learn to use the edit button. |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
There are 2 "files" in the directory called "." and ".." meaning current directory and parent directory, respectively.
These 2 "files" are shown first before other files when iterating through directory files. To skip them, call next_file() before your loop so you won't get them. Code:
|
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
Actually I posted those names just to make you understand . It can be of any name .
Like hello.dll And as I am trying to make it dynamic it should again start from the starting file once the last file reached . |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
You can just make a list of the filenames either hardcoded or in an ini file then you can easily track everything from there.
|
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
Code:
#include <amxmodx>here is the code ... create one file in config directory and put some dll there . Then start your server , change map . At the time of map change it should take diff diff dll and put it in the base directory |
Re: while( next_file( handleDir, s_Buffer, charsmax( s_Buffer ) ))
Quote:
|
| All times are GMT -4. The time now is 03:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.