Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------
- function widget:GetInfo()
- return {
- name = "Compress Test",
- desc = "Test for compress folder",
- author = "gajop",
- date = "in the future",
- license = "GPL-v2",
- layer = 1001,
- enabled = true,
- }
- end
- function doIt()
- local temp_dir = "_compressfolder_temp_dir"
- Spring.CreateDir(temp_dir)
- local f = assert(io.open(temp_dir .. "/example_file.txt", "wb"))
- local text = "Hello World"
- f:write(text)
- assert(f:close())
- VFS.CompressFolder(temp_dir, "zip", "example.zip")
- os.remove(temp_dir)
- end
- function widget:Initialize()
- success, errMsg = pcall(doIt)
- if not success then
- Spring.Echo(errMsg)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment