diff options
Diffstat (limited to 'util.lua')
| -rw-r--r-- | util.lua | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -16,7 +16,11 @@ local function json_enc(x) return json:encode(x) end -local mkdir, rand_string +local function send(peer, x) + peer:send(json_enc(x)) +end + +local rand_string if love then rand_string = function(n) @@ -33,11 +37,6 @@ else local rand_file = rand_file or io.open("/dev/random") return rand_file:read(n) end - -- awful - mkdir = function(x) - local status = os.execute("mkdir -p " .. x) - return status == true - end end return { @@ -47,4 +46,5 @@ return { base64_enc = base64.encode, json_dec = json_dec, json_enc = json_enc, + send = send, } |
