SA-MP Forums Archive
How to delete thousands of files. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to delete thousands of files. (/showthread.php?tid=363985)



How to delete thousands of files. - PinkFloydLover - 29.07.2012

Hello, I opened up my server a couple months ago, now after realizing how terrible this host is, I have decided I'm going to change server hosts to a new company.

Now I have to transfer 14000 registered files over to the directory of the new server.

I was thinking instead of moving them all over, I could save myself alot of time by removing all the files which have less then 1 hour online time, through a custom function placed under OnGameModeInit.

I've thought about how i'm going to do this for a while now, and I am starting to think that it is impossible.

If anyone has any experience doing something like this, it would help me alot.


Re: How to delete thousands of files. - [MM]RoXoR[FS] - 29.07.2012

Once, I had this problem.

We deleted all the accounts.
Players who showed us their stats using a proof(pic), we gave them their stats.


Re: How to delete thousands of files. - Vince - 29.07.2012

And that's why SQL is so handy, as one could just do "delete from users where onlinetime < 60" and be done.

Now, if you save files with the player's name as the title, you're going to have a hard time. If you have shell access (which I presume you don't) you could execute some batch/bash instructions to send the directory listing to a file and work from there.

I also saw some file manager plugin the other day (by JaTochNietDan IIRC). Maybe that can be used. I have no idea if it allows you to list directory contents, though.