Creating files into a folder: how? -
Jochemd - 28.05.2010
Hello,
Can someone give me a link to a tutorial how to create files into a folder in Scriptfiles? Or can you explain it here, if you want? I would appreciate it.
Regards, Jochem
EDIT: Map >> folder, I forgot it is another word in english
Re: Creating files into a folder: how? -
MadeMan - 28.05.2010
https://sampwiki.blast.hk/wiki/File_Functions
Re: Creating files into a folder: how? -
Jochemd - 28.05.2010
Well, that doesn't show anything about a folder. Sorry.
BTW, if possible, I prefer Dini.
Re: Creating files into a folder: how? -
Hiddos - 28.05.2010
use fopen, it opens a file and if it isn't there already it creates it for you.
Re: Creating files into a folder: how? -
TruServe - 28.05.2010
This may help, it's a register system tutorial but it's the basic concept that you need to learn.
http://forum.sa-mp.com/index.php?topic=126584.0
Re: Creating files into a folder: how? -
MadeMan - 28.05.2010
If you want to create a file called
myfile.txt in a folder called
myfolder you can do this
pawn Код:
new File:handle = fopen("myfolder/myfile.txt", io_write);
fwrite(handle, "Key=Value");
fclose(handle);
With dini it's just
pawn Код:
dini_Set("myfolder/myfile.txt", "Key", "Value");
Re: Creating files into a folder: how? -
Jochemd - 28.05.2010
Ok, thank you MateMan. I thought it should be something like that and now I'm ensured
Re: Creating files into a folder: how? -
Zamaroht - 28.05.2010
Remember that you can create files that way, but you can't create directories (or folders). The directories have to be created beforehand, or the server will crash.
Re: Creating files into a folder: how? -
NewTorran - 28.05.2010
Seeing as this topics here,
I started using DINI because i didnt get File Functions, BUT i understand them now,
So what would you guys suggest using, DINI or File Functions?
Re: Creating files into a folder: how? -
MadeMan - 28.05.2010
Quote:
|
Originally Posted by Joe Torran C
Seeing as this topics here,
I started using DINI because i didnt get File Functions, BUT i understand them now,
So what would you guys suggest using, DINI or File Functions?
|
Dini is easier to use, but file functions can be faster.