Re: [REL] FileManager 1.2 -
LZLo - 06.01.2012
solved
Re: [REL] FileManager 1.2 -
aGhillieSniper - 04.02.2012
Best plug-in ever!
Re: [REL] FileManager 1.2 -
JaTochNietDan - 10.03.2012
Quote:
Originally Posted by RealCop228
Could I do this with this system?
pawn Код:
file_delete("gamemodes\filename.amx")
EDIT: It only works if I do this:
pawn Код:
file_delete("gamemodes/filename.amx");
Will this not work on Linux due to there needing to be a forward slash, instead of a backwards slash?
|
In this context, you only use forward slashes for either Operating System, as a blackslash is used as an escape character in most programming languages, including PAWN.
http://en.wikipedia.org/wiki/Backslash#Usage
Quote:
Originally Posted by SVRP
Does the plugin support subfolders?
I want to create a directory within a directory, but when I perform the code the server shuts down because it can't create a file within the directory because the directory doesn't exists, and hasn't been created.
So, would this peace of code work?
pawn Код:
public createFolder(string[]) { new dir[]; format(dir, sizeof(dir), "folders/custom/%s",string); if(!dir_exists(dir)) { dir_create(dir); } return 1; }
|
You will need to make sure that all of the directories above the subdirectory exist before trying to create it.
Quote:
Originally Posted by kizla
is this a fastes thing with file,, for creating and reading?
|
There have been benchmarks performed throughout the forums between several "file systems". I cannot give you a definitive answer as I have not personally tested it myself. I can say that the benchmarks done seemed generally favourable of this plugin in certain situations.
Re: [REL] FileManager 1.2 -
sam1929 - 13.03.2012
i like this because some Server_Owners can not buy a vps or a Dedicated Server or even a server host where they give you a File Manager good job on this JaTochNietDan and keep up the good work bro +Reputation for you on this to That's All Thanks Again From Founder Tom_Fox Server_Owner Of Tom's Games Servers
http://www.tomsgameservers.com
Installing FileManager Plugin -
Dennis_Smith - 18.03.2012
So I just downloaded the FileManager plugin and put it in my plugins folder, and added it to the plugins line in my server config. But what else do I need to do so that I can use the functions it has?
Re: Installing FileManager Plugin -
JaTochNietDan - 18.03.2012
Quote:
Originally Posted by Dennis_Smith
So I just downloaded the FileManager plugin and put it in my plugins folder, and added it to the plugins line in my server config. But what else do I need to do so that I can use the functions it has?
|
Put the include file in your pawno/includes directory and then include it in the project that you are working on. You can then use any functions that the plugin provides as intended.
Re: [REL] FileManager 1.2 -
Dennis_Smith - 18.03.2012
Why doesn't this work? The file does exist with "Text" in it but doesn't return true.
Код:
if(!file_read("Dennis_Smith.txt","Text"))
{
print("Found file");
}
Re: [REL] FileManager 1.2 -
JaTochNietDan - 19.03.2012
Quote:
Originally Posted by Dennis_Smith
Why doesn't this work? The file does exist with "Text" in it but doesn't return true.
Код:
if(!file_read("Dennis_Smith.txt","Text"))
{
print("Found file");
}
|
That's not how file_read is intended to be used, the second argument of file_read is where you put an array to store the data that is read from the text file. For example:
pawn Код:
new str[48];
file_read("Dennis_Smith.txt", str);
if(!strcmp(str, "Text")) print("Found file");
Re: [REL] FileManager 1.2 -
Dennis_Smith - 24.03.2012
Why is this not working correctly? Am I indexing the file wrong? The folders are already existing.
Код:
file_create("scriptfiles/users/Dennis_Smith.txt");
Re: [REL] FileManager 1.2 -
TheLazySloth - 29.03.2012
What am I doing wrong?
pawn Код:
stock SaveServer(Stat[], format[], {Float,_}) {
if(!dir_exists("Saved/")) dir_create("Saved/");
if(!dir_exists("Saved/Server/")) dir_create("Saved/Server/");
new File[100],
String[100];
format(File, 100, ServerFile, Stat); // #define ServerFile "Saved/Server/%s.ini"
if(file_exists(File)) file_delete(File);
switch(format[0]) {
case 's': {
new Result[100];
for(new ResultPos = 0; getarg(3, ResultPos) != 0; ResultPos++) {
Result[ResultPos] = getarg(3, ResultPos);
}
format(String, 100, "%s", Result);
}
case 'd', 'i': {
new Result = getarg(3);
format(String, 100, "%d", Result);
}
case 'f': {
new Float: Result = Float: getarg(3);
format(String, 100, "%f", Result);
}
}
file_create(File);
file_write(File, String);
printf("%s", String);
return true;
}
When it saves, it doesn't save the correct value.
Edit:
I've noticed:
- All strings save as
0€
- All values save as
35120
Re: [REL] FileManager 1.3 -
JaTochNietDan - 09.05.2012
Updated to 1.3- Cleaned up the code
- Fixed some minor return issues with file_read
- Added file_copy - Requested function
- Added a way to read files line by line - Requested feature
- Added more comprehensible documentation
So you can now read from a file line by line, this was requested to me a couple of times. Here is an example of how to do it:
pawn Код:
new File: f = f_open("server.cfg"); // Open the file.
new string[100];
while(f_read(f, string)) // Returns true when a line is found
print(string); // Will print each line of the server.cfg
f_close(f); // Make sure to close the file.
Also there was a request for a file_copy function, so that has also been added. It is the same as file_move except it copies the file.
Re : [REL] FileManager 1.3 (9th of May 2012) -
pseudonyme - 11.05.2012
I think this plugin may be usefull to help making security systems against GM stealing.
For example: you can load ur full GM as a Filterscript and then unload it and delete it if needed.
Re: [REL] FileManager 1.3 (9th of May 2012) -
Mandrakke - 15.06.2012
I do not know if it was already suggested, but an readdir() cannot be made? to read files info from a dir.
Re: [REL] FileManager 1.3 (9th of May 2012) -
JaTochNietDan - 24.06.2012
Quote:
Originally Posted by Mandrakke
I do not know if it was already suggested, but an readdir() cannot be made? to read files info from a dir.
|
Your wish has been granted.
Update- dir_open, dir_close and dir_list have been added for listing a directory functionality, as requested
Re: [REL] FileManager 1.4 (24th of June 2012) -
Niko_boy - 24.06.2012
oh cool updates
thanks for it >: )
AW: [REL] FileManager 1.4 (24th of June 2012) -
Meta - 02.07.2012
holy sh*t, finally a dir_list function
I once made one myself but this one is better
Re: [REL] FileManager 1.4 (24th of June 2012) -
JaTochNietDan - 24.08.2012
Quote:
Originally Posted by Rancho
Nice but, f_write isn't so healthy.Because every f_write opens file, writes it, closes file.
I think that, f_write must be with f_open.
|
Update 1.5- Added f_write for use with f_open
Example to write to a file (wipes previous information in it)
pawn Код:
new File:file = f_open("horse.txt", "w");
fwrite("Welcome");
fwrite(" horses");
fclose(file);
Re: [REL] FileManager 1.4 (24th of June 2012) -
-Stranger- - 29.09.2012
FileManager 1.5.
Windows XP.
Error: "The procedure entry point GetTickCount64 could not be located in the dynamic link library KERNEL32.dll".
Re: [REL] FileManager 1.4 (24th of June 2012) -
God'Z War - 29.09.2012
Nice work
Re: [REL] FileManager 1.4 (24th of June 2012) - Emmet_ - 01.10.2012
I get this error whenever I start the server with this plugin:
"The procedure entry point GetTickCount64 could not be located in the dynamic link library KERNEL32.dll."
Using Windows XP Home Edition 32 bit, Service Pack 3.