SA-MP Forums Archive
How to create empty file in scriptfiles folder programely - 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 create empty file in scriptfiles folder programely (/showthread.php?tid=621975)



How to create empty file in scriptfiles folder programely - Fastaykoo - 17.11.2016

How to create empty file in scriptfiles folder programely?


Re: How to create empty file in scriptfiles folder programely - RedRex - 17.11.2016

Right Click > NEW> File


Re: How to create empty file in scriptfiles folder programely - Fastaykoo - 17.11.2016

:3 i mean script that create new file


Re: How to create empty file in scriptfiles folder programely - F1N4L - 17.11.2016

Код:
new File:CreateNewFile = fopen("FileName.txt", io_write);
fwrite(CreateNewFile, "");
fclose(CreateNewFile);



Re: How to create empty file in scriptfiles folder programely - NeXoR - 17.11.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
new File:CreateNewFile = fopen("FileName.txt", io_write);
fwrite(CreateNewFile, "");
fclose(CreateNewFile);
Not really, the fwrite is not necessary
PHP код:
new File:CreateNewFile fopen("FileName.txt"io_readwrite);
fclose(CreateNewFile); 



Re: How to create empty file in scriptfiles folder programely - NaS - 17.11.2016

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
Not really, the fwrite is not necessary
PHP код:
new File:CreateNewFile fopen("FileName.txt"io_readwrite);
fclose(CreateNewFile); 
A safety check would be good in place, so if it fails you don't crash the server with fclose.

PHP код:
new File:CreateNewFile fopen("FileName.txt"io_write);
if(
CreateNewFilefclose(CreateNewFile); 



Re: How to create empty file in scriptfiles folder programely - Vince - 17.11.2016

And what would be the point? Can't you just create it when you need it?