Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Dear Kurofeget,
- Someone forgot that into the leaked version of clockwork, so i hope you sales will discrease by 100%
- Now the save system is 100% working.
- module link : http://www.solidfiles.com/d/f262e26a2f/
- (place this code in clockwork/framework/sv_cloudax.lua)
- -Lapin
- ]]
- require("hio")
- fileio = {}
- local function checkFolder(path)
- local t = string.Explode("/", path)
- if table.Count(t) > 1 then
- local p = t[1]
- for i = 1, #t - 1 do
- if !hIO.DirExists(p) then
- hIO.MakeDirectory(p)
- end
- p = p .. "/" .. t[i+1] or ""
- end
- end
- end
- function fileio.Read(path)
- checkFolder(path)
- if hIO.FileExists(path) then
- return hIO.Read(path)
- else
- return ""
- end
- end
- function fileio.Write(path, cont)
- checkFolder(path)
- hIO.Write(path, cont)
- end
- function fileio.MakeDirectory(path)
- checkFolder(path)
- hIO.MakeDirectory(path)
- end
- function fileio.Delete(path)
- checkFolder(path)
- hIO.Remove(path)
- end
- function fileio.Append(path, cont)
- checkFolder(path)
- hIO.Write(path, fileio.Read(path) .. cont)
- end
Add Comment
Please, Sign In to add comment