Creating files into a folder: how?
#1

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
Reply
#2

https://sampwiki.blast.hk/wiki/File_Functions
Reply
#3

Well, that doesn't show anything about a folder. Sorry.

BTW, if possible, I prefer Dini.
Reply
#4

use fopen, it opens a file and if it isn't there already it creates it for you.
Reply
#5

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
Reply
#6

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");
Reply
#7

Ok, thank you MateMan. I thought it should be something like that and now I'm ensured
Reply
#8

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.
Reply
#9

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?
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)