Reading files
#1

Hello i am transfering my player files which are DINI to MYSQL DB and i was wondering if there is a way to loop through 20,000+ files without actually knowing the file names because every file is named differently.

For example:

Код:
new file[60];
for(new i=0; i<20000; i++)
{
   format(file,sizeof(file),"( i can't tell you what this part is because all 20,000+ files are named differently ).ini");

   if(!fexist(file)){ continue; }
   else
   {
     //Transfer everythying to MYSQL
   }
}
Reply
#2

I think this way is better:

In OnPlayerConnect (I think), check is there is a .ini file. If yes, re-write everything to mysql and delete the file.
Reply
#3

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
I think this way is better:

In OnPlayerConnect (I think), check is there is a .ini file. If yes, re-write everything to mysql and delete the file.
Yeah, but that will cause lag and i will have to always check for the ini file
Reply
#4

Y_Files: https://sampforum.blast.hk/showthread.php?tid=177028

pawn Код:
new idxlol = 0, file[60];
while(ffind("*.ini", file, sizeof(file), idxlol))
{
    //Transfer everything to MYSQL
}
Reply
#5

Quote:
Originally Posted by Edga
Посмотреть сообщение
Yeah, but that will cause lag and i will have to always check for the ini file
Done that about a year ago (with old grp mode...) and that not causes lag. About a month later we removed the code and everything was okey! This is best way no doubt.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)