mirror of
https://github.com/TangentFoxy/.lua-files.git
synced 2024-11-20 21:34:23 +00:00
utility.tmp_file_name function added
This commit is contained in:
parent
a5a8e3a5f3
commit
72f059506c
@ -3,7 +3,7 @@ math.randomseed(os.time())
|
||||
-- TODO look for popen command and fall back to outputting to file if its unavailable
|
||||
function os.command(command)
|
||||
local file = assert(io.popen(command, 'r'))
|
||||
local output = assert(file:read('*a'))
|
||||
local output = assert(file:read('*all'))
|
||||
file:close()
|
||||
return output
|
||||
end
|
||||
@ -32,6 +32,10 @@ utility.uuid = function()
|
||||
return (("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"):gsub("[xy]", fn))
|
||||
end
|
||||
|
||||
utility.tmp_file_name = function()
|
||||
return ".tmp." .. utility.uuid()
|
||||
end
|
||||
|
||||
utility.escape_quotes = function(input)
|
||||
input = input:gsub("\\", "\\\\")
|
||||
input = input:gsub("\"", "\\\"")
|
||||
|
Loading…
Reference in New Issue
Block a user