From GMod Wiki
| 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
| Syntax | rawio.readfile( String file path ) |
| Description: |
| Returns the file specified. |
| Returns: | File Contents or 0 on error |
| Description | Returns the file specified. |
| Used on | client |
| 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 |
| Output | The Content of the File |
Library Function
| Syntax | rawio.writefile( String file path, String data to put into file, ) |
| Description: |
| Creates the file with the data above. |
| Returns: | Boolean 0 on error |
| Description | Creates the file with the data above. |
| Used on | client |
| Code |
retr = rawio.writefile("C:\LuaGMod\hi.txt",file)
if retr ~= 0 then
print("File written ok.")
else
print("Error writing file: "..retr)
end |
| Output | The file on your HardDrive |
Library Function
| Syntax | rawio.deletefile( String File path ) |
| Description: |
| Delete file. |
| Returns: | Boolean 1 on success, 0 on failure. |
| Description | Returns the file specified. |
| Used on | client |
| Code |
require("rawio")
retr = rawio.deletefile("C:\Program Files (x86)\Steam\steamapps\[UserName]\garrysmod\garrysmod\delete.me")
|
| Output | None |
Library Function
| Syntax | rawio.mkdir( String Directory path ) |
| Description: |
| Makes Directory. |
| Returns: | Boolean 1 on success, 0 on failure. |
| Description | Returns the file specified. |
| Used on | client |
| Code |
retr = rawio.mkdir("C:\LuaGMod")
if retr ~= 0 then
print("Directory created ok.")
else
print("Error making dir: "..retr)
end |
| Output | New 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