Raised This Month: $51 Target: $400
 12% 

[INC] HFile - Hirsw0w's Files


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hirsw0w
Junior Member
Join Date: Jul 2014
Old 07-21-2014 , 06:27   [INC] HFile - Hirsw0w's Files
Reply With Quote #1

HFile - Hirsw0w's Files
Author : Hirsw0w
Version 1.0


So You ask yourself why do i need use this and not others save-system file?, ok - Good question.
This file is fastest save than others, it's really easy to edit it and insert more things.
All the Functions in the INC File is necessary and really easy to use

Writing Stocks:
PHP Code:
*     HFile_WriteString(Data[],Value[]) - Write string save on the file.
*     
HFile_WriteInt(Data[],Value) - Write a IntNumber save on the file.
*     
HFile_WriteFloat(Data[],Float:Value) - Write a Float save on the file.
*     
HFile_WriteBool(Data[],bool:Value) - Write a boolean save on the file
Reading Stocks:
PHP Code:
*      HFile_ReadString(Data[]) - Read a string from the file by the data.
*     
HFile_ReadInt(Data[]) - Read a IntNumber from the file by the data.
*     
HFile_ReadFloat(Data[]) - Read a Float from the file by the data.
*     
HFile_ReadBool(Data[]) - Read a Boolean from the file by the data
Other Stocks:
PHP Code:
*     HFile_Copy(file1,file2) - Copy file for other location
*     HFile_Rename(file1,file2) - change file name for another
*     HFile_Open(filename) - Open a file need to write and read )
*     
HFile_Close() - Close a file after usage needed for save )
*     
HFile_WriteString(Data[],Value[]) - Write string save on the file.
*     
HFile_UnSet(Data[]) - Remove a data.
*     
HFile_IsSet(Data[]) - Check if Data is exists
*     HFile_GetDataName(Value[]) - Get a data name by the value
*     HFIle_GetFileSize(filename[]) - Get the file size
Macros:
PHP Code:
*     HFile_Create(filenamethat a macro for the functions fclose and fopen. ( thats create a new file )
*     
HFile_Exists(filenamethat a macro for the function file_exists. ( thats check if file exists )
*     
HFile_Delete(filenamethat a macro for the function delete_file. ( thats delete a file 
Defines:
PHP Code:
*     MAX_VALUE_STRING is the max chars in the value. (default: 50 )
*     
MAX_DATA_STRING is the max chars in the data. (default: 50 
*     
MAX_FILE_NAME is the max chars in the file name. (default: 100 )
*     
MAX_DATA is the max data the include can contain. (default: 75 
Credits:

Hirsw0w - Builed the include.

Bugs and Suggestions
If you found a bug or you have a suggestions write in the topic or write me me Privte Message.

Enjoy! If you need help with the include please send Private Message for me.
Attached Files
File Type: inc HFile.inc (5.7 KB, 361 views)

Last edited by Hirsw0w; 07-21-2014 at 06:45.
Hirsw0w is offline
Strick3n
Member
Join Date: Apr 2013
Old 07-21-2014 , 06:41   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #2

haha, this shit gonna be trashed LOLZ.
this one is x999 times better than this shit
https://forums.alliedmods.net/showthread.php?t=76453

your filesystem is useless you copied this plugin:
https://forums.alliedmods.net/showthread.php?t=220061
same same new name.

Last edited by Strick3n; 07-21-2014 at 06:42. Reason: my eyes! i'm blind. (his english is horrible)
Strick3n is offline
Hirsw0w
Junior Member
Join Date: Jul 2014
Old 07-21-2014 , 06:59   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #3

Quote:
Originally Posted by Strick3n View Post
haha, this shit gonna be trashed LOLZ.
this one is x999 times better than this shit
https://forums.alliedmods.net/showthread.php?t=76453

your filesystem is useless you copied this plugin:
https://forums.alliedmods.net/showthread.php?t=220061
same same new name.
you check the code? why I are you think so?
you don't open the code you can't say i copied that.
this is better from the others.
check the SINI and check HFILE and then talk ;)
Hirsw0w is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-21-2014 , 10:29   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #4

So, what if a file has more than 50 characters?
You are using 128 cell's variable as a buffer and you can only save 50 cell's on your global variable.
It's faster only if you want to read the file multiple times.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Hirsw0w
Junior Member
Join Date: Jul 2014
Old 07-21-2014 , 10:35   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #5

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
So, what if a file has more than 50 characters?
You are using 128 cell's variable as a buffer and you can only save 50 cell's on your global variable.
It's faster only if you want to read the file multiple times.
thats faster in write to, 8 seconds for 10,000 vars.
and that not 50 cell's that 100 this is Data and Value that split it to two strings.
Hirsw0w is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-21-2014 , 12:28   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #6

Quote:
Originally Posted by Hirsw0w View Post
thats faster in write to, 8 seconds for 10,000 vars.
and that not 50 cell's that 100 this is Data and Value that split it to two strings.
100 is still too low.

10000 in 8 seconds? Wow, that's CRAP. It's too slow. Eight seconds is a LOT of time.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Hirsw0w
Junior Member
Join Date: Jul 2014
Old 07-21-2014 , 12:34   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #7

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
100 is still too low.

10000 in 8 seconds? Wow, that's CRAP. It's too slow. Eight seconds is a LOT of time.
all the others 100 seconds and 40 seconds...
Hirsw0w is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-21-2014 , 19:34   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #8

Quote:
Originally Posted by Hirsw0w View Post
all the others 100 seconds and 40 seconds...
Mine takes less than 0.000000
PHP Code:
new Float:startTime get_gametime();
if (
file_exists("test.txt")){
    
unlink("test.txt");
}
new 
file fopen("test.txt""a");
for (new 
i=0i<10000i++){
    
fprintf(file"var%d = data%d^r^n"ii);
}
fclose(file);
console_print(0"Time: %f"startTime-get_gametime()); 
Output:
Code:
Time: 0.000000
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 07-21-2014 , 19:39   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #9

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Mine takes less than 0.000000
PHP Code:
new Float:startTime get_gametime();
if (
file_exists("test.txt")){
    
unlink("test.txt");
}
new 
file fopen("test.txt""a");
for (new 
i=0i<10000i++){
    
fprintf(file"var%d = data%d^r^n"ii);
}
fclose(file);
console_print(0"Time: %f"startTime-get_gametime()); 
Output:
Code:
Time: 0.000000
It should be: get_gametime()-startTime not startTime-get_gametime()
TheDS1337 is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-21-2014 , 20:50   Re: [INC] HFile - Hirsw0w's Files
Reply With Quote #10

You are right
Btw the output will still be 0.000000
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode