RawIO

From GMod Wiki

Jump to: navigation, search
Third-party Library - gm_rawio.dll
Name rawIO
Description:
Raw Input Output file access
Download rawio.dll
Source rawio-src.zip
Author Hexxeh

Functions

Library Function
Syntaxrawio.readfile( String file path )
Description:
Returns the file specified.
Returns:File Contents or 0 on error
DescriptionReturns the file specified.
Used onclient
Code
 
    require("rawio")
    retr = rawio.readfile("C:\Program Files (x86)\Steam\steamapps\[UserName]\garrysmod\garrysmod\gameinfo.txt")
       if retr ~= 0 then
       print(retr)
       file = retr
    else
       print("Error: "..retr)
    end 
OutputThe Content of the File
Library Function
Syntaxrawio.writefile( String file path, String data to put into file, )
Description:
Creates the file with the data above.
Returns:Boolean 0 on error
DescriptionCreates the file with the data above.
Used onclient
Code
 
    retr = rawio.writefile("C:\LuaGMod\hi.txt",file)
    if retr ~= 0 then
        print("File written ok.")
    else
        print("Error writing file: "..retr)
    end 
OutputThe file on your HardDrive
Library Function
Syntaxrawio.deletefile( String File path )
Description:
Delete file.
Returns:Boolean 1 on success, 0 on failure.
DescriptionReturns the file specified.
Used onclient
Code
 
    require("rawio")
    retr = rawio.deletefile("C:\Program Files (x86)\Steam\steamapps\[UserName]\garrysmod\garrysmod\delete.me")
 
OutputNone
Library Function
Syntaxrawio.mkdir( String Directory path )
Description:
Makes Directory.
Returns:Boolean 1 on success, 0 on failure.
DescriptionReturns the file specified.
Used onclient
Code
 
   retr = rawio.mkdir("C:\LuaGMod")
if retr ~= 0 then
    print("Directory created ok.")
else
    print("Error making dir: "..retr)
end 
OutputNew Directory.


Info

Garry's Mod file functions restrict you to the data directory. And with good reason. But there's probably a few cases where writing outside that directory would be very handy. So here's a module that lets you do just that.

This Third-party Library was not made by me I however obtained permission form the author Hexxeh

This library is used in Luapad a handy tool for all lua programmers

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox