SA-MP Forums Archive
is it possible?? read this!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: General (https://sampforum.blast.hk/forumdisplay.php?fid=13)
+--- Thread: is it possible?? read this!! (/showthread.php?tid=544042)



is it possible?? read this!! - kloning1 - 30.10.2014

is it possible? delete a file using the command in the script


Re: is it possible?? read this!! - Rudy_ - 30.10.2014

-.- ...........................

YES, and wrong place


Re: is it possible?? read this!! - Koenigsegg - 30.10.2014

What do you mean?


Re: is it possible?? read this!! - Classical - 30.10.2014

I'm fairly sure it is possible. Yes.


Re: is it possible?? read this!! - slowride326 - 30.10.2014

Quote:
Originally Posted by kloning1
Посмотреть сообщение
is it possible? delete a file using the command in the script
Recreate this thread in the "Scripting Help". With a decent title like.. hmm.. "How to delete a file via a command".

http://forum.sa-mp.com/forumdisplay.php?f=12


Re: is it possible?? read this!! - Mauzen - 30.10.2014

https://sampwiki.blast.hk/wiki/Fremove

Works only for files in the scriptfiles directory of the server for security.
You cant access any files of the clients, and access outside of that server directory is only possible with plugins.


Re: is it possible?? read this!! - Abagail - 30.10.2014

Yes, it is, if you even tried to use ******. I'll even re-post what the wiki says in-case you're also too lazy to click a link!

Description:
Delete a file.

Parameters:
(name[])
name[] The path of the file to delete. (NOTE: NOT a file handle)

Return Values:
1: The function executed successfully.
0: The function failed to execute. The file doesn't exist, or you don't have permission to delete it.

Important
Note
The file path must be valid.

Note
Files that are currently open (fopen) must be closed first (fclose) to be deleted.

Example Usage:
fremove("Example.txt");


Re: is it possible?? read this!! - DanishHaq - 31.10.2014

If you don't want to use the fremove function or the thing you want to delete is a completely different thing, you could simply script a boolean to check whether the file is active or not, if true then the code would continue, if false then it would be the replica of the file being deleted but still being there.