mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
49 lines
877 B
Lua
49 lines
877 B
Lua
--[[
|
|
| This file was obtained through the combined efforts
|
|
| of Madbluntz & Plymouth Antiquarian Society.
|
|
|
|
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
|
| Maloy, DrPepper10 @ RIP, Atle!
|
|
|
|
|
| Visit for more: https://plymouth.thetwilightzone.ru/
|
|
--]]
|
|
|
|
|
|
|
|
|
|
function file.Read( filename, path )
|
|
|
|
if ( path == true ) then path = "GAME" end
|
|
if ( path == nil || path == false ) then path = "DATA" end
|
|
|
|
local f = file.Open( filename, "rb", path )
|
|
if ( !f ) then return end
|
|
|
|
local str = f:Read( f:Size() )
|
|
|
|
f:Close()
|
|
|
|
if ( !str ) then str = "" end
|
|
return str
|
|
|
|
end
|
|
|
|
function file.Write( filename, contents )
|
|
|
|
local f = file.Open( filename, "wb", "DATA" )
|
|
if ( !f ) then return end
|
|
|
|
f:Write( contents )
|
|
f:Close()
|
|
|
|
end
|
|
|
|
function file.Append( filename, contents )
|
|
|
|
local f = file.Open( filename, "ab", "DATA" )
|
|
if ( !f ) then return end
|
|
|
|
f:Write( contents )
|
|
f:Close()
|
|
|
|
end |