Folder creating?
#1

Hi, I've been trying for hours but I can't seem to find out how to make a folder...

For example I have

scriptfiles/blahblah/

and I want to make a folder in there thats name whatever so it will be like

scriptfiles/blahblah/whatever/

how would I do that?
Reply
#2

File System like
Y_INI
DINI
etc..
Reply
#3

Obviously but dini nor y_ini uses a different method then this

pawn Код:
fopen("blahblah/whatever/", io_readwrite);
Which doesn't work...
Reply
#4

Quote:
Originally Posted by [WF]Demon
Посмотреть сообщение
Obviously but dini nor y_ini uses a different method then this

pawn Код:
fopen("blahblah/whatever/", io_readwrite);
Which doesn't work...
i don't think it will auto create the folder for you , you must create for example

pawn Код:
format(SaveVar, sizeof(SaveVar), "/Files/%s.ini",name); // example
the folder Files must be created then the other stuff will be created in that folder.
Reply
#5

I've attempted that.

pawn Код:
format(file, sizeof(file), "blahblah/%s/blah.txt", pname);
new File:fileopen = fopen(file, io_readwrite);
fclose(fileopen);
Crashes the server.
Reply
#6

Quote:
Originally Posted by [WF]Demon
Посмотреть сообщение
I've attempted that.

pawn Код:
format(file, sizeof(file), "blahblah/%s/blah.txt", pname);
new File:fileopen = fopen(file, io_readwrite);
fclose(fileopen);
Crashes the server.
Should'nt %s be %s.ini or is it a folder?
Reply
#7

Use FileManager made by JaTochNietDan
dir_create(directory[]);
Reply
#8

You can do this with this plugin: http://files.jatochnietdan.com/?view...ecute%20Plugin

So if you're running a Windows server:

pawn Код:
exec("mkdir scriptfiles\\blahblah");
or on Linux (notice forward slash):

pawn Код:
exec("mkdir scriptfiles/blahblah");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)