Raised This Month: $32 Target: $400
 8% 

Module: FileX


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-07-2009 , 15:30   Module: FileX
Reply With Quote #1

All I am here to do is to post the modules to the people who want them.
Uptades/New modules/Request can be found at DivinityX.no-ip.org/forum.
Don't bother visiting at this point. Divinity doesn't have any new modules nor any updates unless requested.
I am not Divinity, don't ban me.

This module is pretty powerful. It can cause just as much damage ( if used incorrectly ) as it can create freedom. Only the plugin creator can decide what these plugins will do. DivinityX creates no limitations.
If you use this incorrectly, to harm the server in any way or exploiting/accessing things you should not have access to you are most likely to get banned by your server provider, if not worse... ( Sued for example )
NEVER use a plugin with missing source code that requires this module to run.
DivinityX takes NO responsibility.

With that said, here you go:



FileX:
PHP Code:
#if defined _FileX_included
  #endinput
#endif
#define _FileX_included
#if !defined _file_included
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
 
/* Attempts to remove a directory.
* Returns 1 on success, 0 on failure.
* Note that you cannot remove a directory that has files on most operating systems.
*/
native DeleteDirX(const path[]);
/* Deletes file. Returns 1 on success, 0 on failure. */
native DeleteFileX(const file[]);
/* Checks if a file exists. Returns 1 if it exists, 0 if it doesn't. */
native FileExistsX(const file[]);
/* Returns a file size in bytes if flag is set to 0.
* When flag is set to 1 returns number of lines in the file,
* and when flags is 2, function returns 1 if the file ends
* with line feed. If file doesn't exist returns -1. */
native FilesizeX(const file[], flag=0);
//Open a file, returns a handle or 0 on failure
native fOpenX(const filename[], const mode[]);
/* Returns 0 on success, -1 on failure. */
native MakeDirX(const dirname[]);
/* Returns a handle to a directory. */
native OpenDirX(const dir[], firstfile[], len);
/* Renames a file. Returns 0 on failure, 1 on success. */
native RenameX(const oldname[], const newname[]);
/* Checks if a directory exists */
stock DirExistsX(const dir[]) { return ( FileExistsX(dir) && FilesizeX(dir) == -) ; }
/* These are just to fit the original natives with mine. */
#define fCloseX(%0) fclose(%0)
#define fReadX(%0,%1,%2) fread(%0, %1, %2)
#define fReadBlocksX(%0,%1,%2,%3) fread_blocks(%0, %1, %2, %3)
#define fReadRawX(%0,%1,%2,%3) fread_raw(%0, %1, %2, %3)
#define fWriteX(%0,%1,%2) fwrite(%0, %1, %2)
#define fWriteBlocksX(%0,%1,%2,%3) fwrite_blocks(%0, %1, %2, %3)
#define fWriteRawX(%0,%1,%2,%3) fwrite_raw(%0, %1, %2, %3)
#define fEofX(%0) feof(%0)
#define fGetSX(%0,%1,%2) fgets(%0, %1, %2)
#define fPutSX(%0,%1,%2) fputs(%0, %1, %2)
#define fPrintFX(%0,%1,%2) fprintf(%0, %1, %2)
#define fSeekX(%0,%1,%2) fseek(%0, %1, %2)
#define fTellX(%0) ftell(%0)
#define fGetCX(%0) fgetc(%0)
#define fPutCX(%0,%1) fputc(%0, %1)
#define fUngetCX(%0,%1) fungetc(%0, %1)
#define NextFileX(%0,%1,%2) next_file(%0, %1, %2)
#define CloseDirX(%0) close_dir(%0)
/* And these are to fit my natives with the original */
#define rmdirx(%0) DeleteDirX(%0)
#define delete_dirx(%0) DeleteDirX(%0)
#define remove_dirx(%0) DeleteDirX(%0)
#define delete_filex(%0) DeleteFileX(%0)
#define remove_filex(%0) DeleteFileX(%0)
#define file_existsx(%0) FileExistsX(%0)
#define filesizex(%0,%1) FilesizeX(%0,%1)
#define fopenx(%0,%1) fOpenX(%0,%1)
#define mkdirx(%0) MakeDirX(%0)
#define makedirx(%0) MakeDirX(%0)
#define make_dirx(%0) MakeDirX(%0)
#define createdirx(%0) MakeDirX(%0)
#define create_dirx(%0) MakeDirX(%0)
#define open_dirx(%0,%1,%2) OpenDirX(%0,%1,%2)
#define rename_filex(%0,%1) RenameX(%0,%1)
#define rename_dirx(%0,%1) RenameX(%0,%1)
#define dir_existsx(%0) DirExistsX(%0) 
Attached Files
File Type: zip FileX Source.zip (35.4 KB, 304 views)
File Type: dll FileX_amxx.dll (67.5 KB, 373 views)
File Type: sma Get Plugin or Get Source (SamplePlugin.sma - 1202 views - 3.0 KB)
File Type: inc FileX.inc (2.9 KB, 351 views)

Last edited by [ --<-@ ] Black Rose; 03-28-2009 at 08:08.
[ --<-@ ] Black Rose is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 22:59   Re: Module: FileX
Reply With Quote #2

what does this does o.o
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 05-25-2009 , 23:31   Re: Module: FileX
Reply With Quote #3

Can you please explain us why we should use this and not the functions that are build into amxmodx?
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 05-26-2009 , 12:46   Re: Module: FileX
Reply With Quote #4

With the original natives you can only access the same drive as the server is placed on. ( By using "..\.." et.c. ) This is not based from moddir.
Example:
PHP Code:
new fileh fOpenX("C:\C++\Projects\FileX\FileX_amxx\FileX.cpp""r"); 

Last edited by [ --<-@ ] Black Rose; 05-26-2009 at 12:49.
[ --<-@ ] Black Rose is offline
culd
Member
Join Date: Aug 2009
Old 09-25-2009 , 16:59   Re: Module: FileX
Reply With Quote #5

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
With the original natives you can only access the same drive as the server is placed on. ( By using "..\.." et.c. ) This is not based from moddir.
Example:
PHP Code:
new fileh fOpenX("C:\C++\Projects\FileX\FileX_amxx\FileX.cpp""r"); 
What does means "r"?
culd is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-25-2009 , 17:16   Re: Module: FileX
Reply With Quote #6

This explains it:
http://www.amxmodx.org/funcwiki.php?...open&go=search
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 12-31-2009 , 06:49   Re: Module: FileX
Reply With Quote #7

PHP Code:
#include <amxmodx>
#include <FileX>


public plugin_init() 
{        
    
set_task(5.0,"read")
}

public 
read()
{
    new 
fileh fOpenX("C:\omg\lol.cpp""r")
    
    if(
fileh)
    {    
        new 
data[128]
        
        while(
fgets(fileh,data,127)) // on this line crash
        
{
            
server_print("%s",data)
        }
        
        
fclose(fileh);
    }

Why it crash my server = (

P.s I have updated steam server running on Windows

Last edited by Empowers; 12-31-2009 at 07:16.
Empowers is offline
Send a message via ICQ to Empowers
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-31-2009 , 12:38   Re: Module: FileX
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <FileX>


public plugin_init() 
{        
    
set_task(5.0,"read")
}

public 
read()
{
    new 
fileh fOpenX("C:\omg\lol.cpp""r")
    
    if(
fileh)
    {    
        new 
data[128]
        
        while(!
feof(fileh))
        {
            
fgets(fileh,data,127)
            
server_print("%s",data)
        }
        
        
fclose(fileh);
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

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 21:36.


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